mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
Properly fix network mode patch
This commit is contained in:
parent
66a38a4705
commit
c27f226269
@ -0,0 +1,141 @@
|
|||||||
|
From a14afb074cdf415565227f18e70489da0930a115 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tad <tad@spotco.us>
|
||||||
|
Date: Sat, 29 Dec 2018 06:58:18 -0500
|
||||||
|
Subject: [PATCH] Change UpdateEnabledNetworksValueAndSummary to handle all
|
||||||
|
modes
|
||||||
|
|
||||||
|
Change-Id: I25bab65a6b3743a05f2d76395e59dc3f241a14d3
|
||||||
|
---
|
||||||
|
.../android/phone/MobileNetworkSettings.java | 50 ++++---------------
|
||||||
|
1 file changed, 11 insertions(+), 39 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
|
index d5c09924..75477ad2 100644
|
||||||
|
--- a/src/com/android/phone/MobileNetworkSettings.java
|
||||||
|
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
|
@@ -1085,35 +1085,31 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateEnabledNetworksValueAndSummary(int NetworkMode) {
|
||||||
|
+ boolean invalidMode = false;
|
||||||
|
switch (NetworkMode) {
|
||||||
|
case Phone.NT_MODE_TDSCDMA_WCDMA:
|
||||||
|
case Phone.NT_MODE_TDSCDMA_GSM_WCDMA:
|
||||||
|
case Phone.NT_MODE_TDSCDMA_GSM:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_TDSCDMA_GSM_WCDMA));
|
||||||
|
+ case Phone.NT_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
+ case Phone.NT_MODE_CDMA:
|
||||||
|
+ case Phone.NT_MODE_EVDO_NO_CDMA:
|
||||||
|
+ case Phone.NT_MODE_GLOBAL:
|
||||||
|
+ case Phone.NT_MODE_TDSCDMA_ONLY:
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
break;
|
||||||
|
case Phone.NT_MODE_WCDMA_ONLY:
|
||||||
|
case Phone.NT_MODE_GSM_UMTS:
|
||||||
|
case Phone.NT_MODE_WCDMA_PREF:
|
||||||
|
if (!mIsGlobalCdma) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_WCDMA_PREF));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Phone.NT_MODE_GSM_ONLY:
|
||||||
|
if (!mIsGlobalCdma) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_GSM_ONLY));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_2G);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
@@ -1128,13 +1124,9 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
|
case Phone.NT_MODE_LTE_ONLY:
|
||||||
|
case Phone.NT_MODE_LTE_WCDMA:
|
||||||
|
if (!mIsGlobalCdma) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
|
? R.string.network_4G : R.string.network_lte);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
@@ -1145,33 +1137,12 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
|
controlCdmaOptions(true);
|
||||||
|
controlGsmOptions(false);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_AND_EVDO));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_lte);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
- case Phone.NT_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
- mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
- break;
|
||||||
|
- case Phone.NT_MODE_CDMA:
|
||||||
|
- case Phone.NT_MODE_EVDO_NO_CDMA:
|
||||||
|
- case Phone.NT_MODE_GLOBAL:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_CDMA));
|
||||||
|
- mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
- break;
|
||||||
|
case Phone.NT_MODE_CDMA_NO_EVDO:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_CDMA_NO_EVDO));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_1x);
|
||||||
|
break;
|
||||||
|
- case Phone.NT_MODE_TDSCDMA_ONLY:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_TDSCDMA_ONLY));
|
||||||
|
- mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
- break;
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA_GSM:
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA_GSM_WCDMA:
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA:
|
||||||
|
@@ -1179,16 +1150,12 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
if (isSupportTdscdma()) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_lte);
|
||||||
|
} else {
|
||||||
|
if (isWorldMode()) {
|
||||||
|
controlCdmaOptions(true);
|
||||||
|
controlGsmOptions(false);
|
||||||
|
}
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA ||
|
||||||
|
mIsGlobalCdma ||
|
||||||
|
isWorldMode()) {
|
||||||
|
@@ -1200,10 +1167,15 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
+ invalidMode = true;
|
||||||
|
String errMsg = "Invalid Network Mode (" + NetworkMode + "). Ignore.";
|
||||||
|
loge(errMsg);
|
||||||
|
mButtonEnabledNetworks.setSummary(errMsg);
|
||||||
|
}
|
||||||
|
+ if (!invalidMode) {
|
||||||
|
+ mButtonEnabledNetworks.setValue(
|
||||||
|
+ Integer.toString(NetworkMode));
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
@ -1,13 +1,13 @@
|
|||||||
From 611609a2022a35971ed2b3a6b065baa091313b8e Mon Sep 17 00:00:00 2001
|
From b0eaecdfeeaedc39ec8af6799572c7d549b59f8b Mon Sep 17 00:00:00 2001
|
||||||
From: Tad <tad@spotco.us>
|
From: Tad <tad@spotco.us>
|
||||||
Date: Fri, 28 Dec 2018 14:52:46 -0500
|
Date: Sat, 29 Dec 2018 07:05:47 -0500
|
||||||
Subject: [PATCH] More preferred network modes
|
Subject: [PATCH] More preferred network modes
|
||||||
|
|
||||||
Change-Id: I9bc7d51e780316faa85584168dd8beb2c45e5a6e
|
Change-Id: Ibd97b5209c002547da714cb176094fee57a18f6d
|
||||||
---
|
---
|
||||||
res/values/strings.xml | 47 +++++++++++++++++++
|
res/values/strings.xml | 47 +++++++++++++++++++
|
||||||
.../android/phone/MobileNetworkSettings.java | 46 +++++++++++-------
|
.../android/phone/MobileNetworkSettings.java | 31 ++++++++++--
|
||||||
2 files changed, 76 insertions(+), 17 deletions(-)
|
2 files changed, 74 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
index 5be5e1c7..b8c4b9c6 100644
|
index 5be5e1c7..b8c4b9c6 100644
|
||||||
@ -179,7 +179,7 @@ index 5be5e1c7..b8c4b9c6 100644
|
|||||||
<item>"1"</item>
|
<item>"1"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
|
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
index d5c09924..1104c2ea 100644
|
index 8241b972..8f926bd3 100644
|
||||||
--- a/src/com/android/phone/MobileNetworkSettings.java
|
--- a/src/com/android/phone/MobileNetworkSettings.java
|
||||||
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
@@ -831,8 +831,11 @@ public class MobileNetworkSettings extends PreferenceActivity
|
@@ -831,8 +831,11 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
@ -217,64 +217,46 @@ index d5c09924..1104c2ea 100644
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mButtonPreferredNetworkMode.setSummary(
|
mButtonPreferredNetworkMode.setSummary(
|
||||||
@@ -1093,7 +1096,6 @@ public class MobileNetworkSettings extends PreferenceActivity
|
@@ -1098,6 +1101,12 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
Integer.toString(Phone.NT_MODE_TDSCDMA_GSM_WCDMA));
|
|
||||||
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
break;
|
break;
|
||||||
- case Phone.NT_MODE_WCDMA_ONLY:
|
case Phone.NT_MODE_WCDMA_ONLY:
|
||||||
case Phone.NT_MODE_GSM_UMTS:
|
|
||||||
case Phone.NT_MODE_WCDMA_PREF:
|
|
||||||
if (!mIsGlobalCdma) {
|
|
||||||
@@ -1125,19 +1127,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(
|
|
||||||
- Integer.toString(Phone.NT_MODE_LTE_GSM_WCDMA));
|
|
||||||
- mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
||||||
- ? R.string.network_4G : R.string.network_lte);
|
|
||||||
- } else {
|
|
||||||
- mButtonEnabledNetworks.setValue(
|
|
||||||
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
|
||||||
- mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
||||||
- }
|
|
||||||
- break;
|
|
||||||
case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
|
|
||||||
if (isWorldMode()) {
|
|
||||||
mButtonEnabledNetworks.setSummary(
|
|
||||||
@@ -1199,6 +1188,29 @@ public class MobileNetworkSettings extends PreferenceActivity
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
+ case Phone.NT_MODE_LTE_WCDMA:
|
|
||||||
+ if (!mIsGlobalCdma) {
|
+ if (!mIsGlobalCdma) {
|
||||||
+ mButtonEnabledNetworks.setValue(
|
+ mButtonEnabledNetworks.setSummary(R.string.network_3G_only);
|
||||||
+ Integer.toString(Phone.NT_MODE_LTE_WCDMA));
|
|
||||||
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
||||||
+ ? R.string.network_3G_4G_only : R.string.network_3G_lte_only);
|
|
||||||
+ } else {
|
+ } else {
|
||||||
+ mButtonEnabledNetworks.setValue(
|
|
||||||
+ Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
|
||||||
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
+ }
|
+ }
|
||||||
+ break;
|
+ break;
|
||||||
+ case Phone.NT_MODE_WCDMA_ONLY:
|
case Phone.NT_MODE_GSM_UMTS:
|
||||||
+ mButtonEnabledNetworks.setValue(
|
case Phone.NT_MODE_WCDMA_PREF:
|
||||||
+ Integer.toString(Phone.NT_MODE_WCDMA_ONLY));
|
if (!mIsGlobalCdma) {
|
||||||
+ mButtonEnabledNetworks.setSummary(R.string.network_3G_only);
|
@@ -1121,11 +1130,25 @@ public class MobileNetworkSettings extends PreferenceActivity
|
||||||
|
controlGsmOptions(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
+ if (!mIsGlobalCdma) {
|
||||||
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
|
+ ? R.string.network_4G : R.string.network_lte);
|
||||||
|
+ } else {
|
||||||
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
+ }
|
||||||
+ break;
|
+ break;
|
||||||
+ case Phone.NT_MODE_LTE_ONLY:
|
case Phone.NT_MODE_LTE_ONLY:
|
||||||
+ mButtonEnabledNetworks.setValue(
|
+ if (!mIsGlobalCdma) {
|
||||||
+ Integer.toString(Phone.NT_MODE_LTE_ONLY));
|
|
||||||
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
+ ? R.string.network_4G_only : R.string.network_lte_only);
|
+ ? R.string.network_4G_only : R.string.network_lte_only);
|
||||||
|
+ } else {
|
||||||
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
+ }
|
||||||
+ break;
|
+ break;
|
||||||
default:
|
case Phone.NT_MODE_LTE_WCDMA:
|
||||||
String errMsg = "Invalid Network Mode (" + NetworkMode + "). Ignore.";
|
if (!mIsGlobalCdma) {
|
||||||
loge(errMsg);
|
mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
|
- ? R.string.network_4G : R.string.network_lte);
|
||||||
|
+ ? R.string.network_3G_4G_only : R.string.network_3G_lte_only);
|
||||||
|
} else {
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
--
|
--
|
||||||
2.20.1
|
2.20.1
|
||||||
|
|
@ -0,0 +1,141 @@
|
|||||||
|
From 0b47472891efb2b151e8a02783193846dc48be3e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tad <tad@spotco.us>
|
||||||
|
Date: Fri, 28 Dec 2018 21:18:47 -0500
|
||||||
|
Subject: [PATCH] Change UpdateEnabledNetworksValueAndSummary to handle all
|
||||||
|
modes
|
||||||
|
|
||||||
|
Change-Id: I92fe694627a90b619be21466da0b49cff39826c8
|
||||||
|
---
|
||||||
|
.../android/phone/MobileNetworkSettings.java | 50 ++++---------------
|
||||||
|
1 file changed, 11 insertions(+), 39 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
|
index 0ea4702b4..4bf0f9e9a 100644
|
||||||
|
--- a/src/com/android/phone/MobileNetworkSettings.java
|
||||||
|
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
|
@@ -1423,35 +1423,31 @@ public class MobileNetworkSettings extends Activity {
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateEnabledNetworksValueAndSummary(int NetworkMode) {
|
||||||
|
+ boolean invalidMode = false;
|
||||||
|
switch (NetworkMode) {
|
||||||
|
case Phone.NT_MODE_TDSCDMA_WCDMA:
|
||||||
|
case Phone.NT_MODE_TDSCDMA_GSM_WCDMA:
|
||||||
|
case Phone.NT_MODE_TDSCDMA_GSM:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_TDSCDMA_GSM_WCDMA));
|
||||||
|
+ case Phone.NT_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
+ case Phone.NT_MODE_CDMA:
|
||||||
|
+ case Phone.NT_MODE_EVDO_NO_CDMA:
|
||||||
|
+ case Phone.NT_MODE_GLOBAL:
|
||||||
|
+ case Phone.NT_MODE_TDSCDMA_ONLY:
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
break;
|
||||||
|
case Phone.NT_MODE_WCDMA_ONLY:
|
||||||
|
case Phone.NT_MODE_GSM_UMTS:
|
||||||
|
case Phone.NT_MODE_WCDMA_PREF:
|
||||||
|
if (!mIsGlobalCdma) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_WCDMA_PREF));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Phone.NT_MODE_GSM_ONLY:
|
||||||
|
if (!mIsGlobalCdma) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_GSM_ONLY));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_2G);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
@@ -1466,13 +1462,9 @@ public class MobileNetworkSettings extends Activity {
|
||||||
|
case Phone.NT_MODE_LTE_ONLY:
|
||||||
|
case Phone.NT_MODE_LTE_WCDMA:
|
||||||
|
if (!mIsGlobalCdma) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
|
? R.string.network_4G : R.string.network_lte);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
@@ -1483,33 +1475,12 @@ public class MobileNetworkSettings extends Activity {
|
||||||
|
controlCdmaOptions(true);
|
||||||
|
controlGsmOptions(false);
|
||||||
|
} else {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_AND_EVDO));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_lte);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
- case Phone.NT_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
- mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
- break;
|
||||||
|
- case Phone.NT_MODE_CDMA:
|
||||||
|
- case Phone.NT_MODE_EVDO_NO_CDMA:
|
||||||
|
- case Phone.NT_MODE_GLOBAL:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_CDMA));
|
||||||
|
- mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
- break;
|
||||||
|
case Phone.NT_MODE_CDMA_NO_EVDO:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_CDMA_NO_EVDO));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_1x);
|
||||||
|
break;
|
||||||
|
- case Phone.NT_MODE_TDSCDMA_ONLY:
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_TDSCDMA_ONLY));
|
||||||
|
- mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
|
- break;
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA_GSM:
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA_GSM_WCDMA:
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA:
|
||||||
|
@@ -1517,16 +1488,12 @@ public class MobileNetworkSettings extends Activity {
|
||||||
|
case Phone.NT_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
|
||||||
|
if (isSupportTdscdma()) {
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_lte);
|
||||||
|
} else {
|
||||||
|
if (isWorldMode()) {
|
||||||
|
controlCdmaOptions(true);
|
||||||
|
controlGsmOptions(false);
|
||||||
|
}
|
||||||
|
- mButtonEnabledNetworks.setValue(
|
||||||
|
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
||||||
|
if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA ||
|
||||||
|
mIsGlobalCdma ||
|
||||||
|
isWorldMode()) {
|
||||||
|
@@ -1538,10 +1505,15 @@ public class MobileNetworkSettings extends Activity {
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
+ invalidMode = true;
|
||||||
|
String errMsg = "Invalid Network Mode (" + NetworkMode + "). Ignore.";
|
||||||
|
loge(errMsg);
|
||||||
|
mButtonEnabledNetworks.setSummary(errMsg);
|
||||||
|
}
|
||||||
|
+ if (!invalidMode) {
|
||||||
|
+ mButtonEnabledNetworks.setValue(
|
||||||
|
+ Integer.toString(NetworkMode));
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
@ -1,13 +1,13 @@
|
|||||||
From c9384522f4667ba0f444cff167dfb7a1d348e5b2 Mon Sep 17 00:00:00 2001
|
From 44e79643f7eae9b659473a8ed2d13ffb7e5259ba Mon Sep 17 00:00:00 2001
|
||||||
From: Tad <tad@spotco.us>
|
From: Tad <tad@spotco.us>
|
||||||
Date: Thu, 27 Dec 2018 15:22:46 -0500
|
Date: Fri, 28 Dec 2018 21:22:20 -0500
|
||||||
Subject: [PATCH] More preferred network modes
|
Subject: [PATCH] More preferred network modes
|
||||||
|
|
||||||
Change-Id: I78e8f3b018fd867ad25aecb2296588cf4a6e2347
|
Change-Id: I6ff09db51fcd64829c24509740ed9a52c3d104cb
|
||||||
---
|
---
|
||||||
res/values/strings.xml | 47 +++++++++++++++++++
|
res/values/strings.xml | 47 +++++++++++++++++++
|
||||||
.../android/phone/MobileNetworkSettings.java | 46 +++++++++++-------
|
.../android/phone/MobileNetworkSettings.java | 31 ++++++++++--
|
||||||
2 files changed, 76 insertions(+), 17 deletions(-)
|
2 files changed, 74 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
index a5651571c..7e9ebc2f8 100644
|
index a5651571c..7e9ebc2f8 100644
|
||||||
@ -179,7 +179,7 @@ index a5651571c..7e9ebc2f8 100644
|
|||||||
<item>"1"</item>
|
<item>"1"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
|
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
index 0ea4702b4..ec8824b63 100644
|
index 4bf0f9e9a..bef36528e 100644
|
||||||
--- a/src/com/android/phone/MobileNetworkSettings.java
|
--- a/src/com/android/phone/MobileNetworkSettings.java
|
||||||
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
||||||
@@ -1155,8 +1155,11 @@ public class MobileNetworkSettings extends Activity {
|
@@ -1155,8 +1155,11 @@ public class MobileNetworkSettings extends Activity {
|
||||||
@ -217,64 +217,46 @@ index 0ea4702b4..ec8824b63 100644
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mButtonPreferredNetworkMode.setSummary(
|
mButtonPreferredNetworkMode.setSummary(
|
||||||
@@ -1431,7 +1434,6 @@ public class MobileNetworkSettings extends Activity {
|
@@ -1436,6 +1439,12 @@ public class MobileNetworkSettings extends Activity {
|
||||||
Integer.toString(Phone.NT_MODE_TDSCDMA_GSM_WCDMA));
|
|
||||||
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
||||||
break;
|
break;
|
||||||
- case Phone.NT_MODE_WCDMA_ONLY:
|
case Phone.NT_MODE_WCDMA_ONLY:
|
||||||
case Phone.NT_MODE_GSM_UMTS:
|
|
||||||
case Phone.NT_MODE_WCDMA_PREF:
|
|
||||||
if (!mIsGlobalCdma) {
|
|
||||||
@@ -1463,19 +1465,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(
|
|
||||||
- Integer.toString(Phone.NT_MODE_LTE_GSM_WCDMA));
|
|
||||||
- mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
||||||
- ? R.string.network_4G : R.string.network_lte);
|
|
||||||
- } else {
|
|
||||||
- mButtonEnabledNetworks.setValue(
|
|
||||||
- Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
|
||||||
- mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
||||||
- }
|
|
||||||
- break;
|
|
||||||
case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
|
|
||||||
if (isWorldMode()) {
|
|
||||||
mButtonEnabledNetworks.setSummary(
|
|
||||||
@@ -1537,6 +1526,29 @@ public class MobileNetworkSettings extends Activity {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
+ case Phone.NT_MODE_LTE_WCDMA:
|
|
||||||
+ if (!mIsGlobalCdma) {
|
+ if (!mIsGlobalCdma) {
|
||||||
+ mButtonEnabledNetworks.setValue(
|
+ mButtonEnabledNetworks.setSummary(R.string.network_3G_only);
|
||||||
+ Integer.toString(Phone.NT_MODE_LTE_WCDMA));
|
|
||||||
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
||||||
+ ? R.string.network_3G_4G_only : R.string.network_3G_lte_only);
|
|
||||||
+ } else {
|
+ } else {
|
||||||
+ mButtonEnabledNetworks.setValue(
|
|
||||||
+ Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
|
|
||||||
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
+ }
|
+ }
|
||||||
+ break;
|
+ break;
|
||||||
+ case Phone.NT_MODE_WCDMA_ONLY:
|
case Phone.NT_MODE_GSM_UMTS:
|
||||||
+ mButtonEnabledNetworks.setValue(
|
case Phone.NT_MODE_WCDMA_PREF:
|
||||||
+ Integer.toString(Phone.NT_MODE_WCDMA_ONLY));
|
if (!mIsGlobalCdma) {
|
||||||
+ mButtonEnabledNetworks.setSummary(R.string.network_3G_only);
|
@@ -1459,11 +1468,25 @@ public class MobileNetworkSettings extends Activity {
|
||||||
|
controlGsmOptions(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
+ if (!mIsGlobalCdma) {
|
||||||
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
|
+ ? R.string.network_4G : R.string.network_lte);
|
||||||
|
+ } else {
|
||||||
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
+ }
|
||||||
+ break;
|
+ break;
|
||||||
+ case Phone.NT_MODE_LTE_ONLY:
|
case Phone.NT_MODE_LTE_ONLY:
|
||||||
+ mButtonEnabledNetworks.setValue(
|
+ if (!mIsGlobalCdma) {
|
||||||
+ Integer.toString(Phone.NT_MODE_LTE_ONLY));
|
|
||||||
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
+ ? R.string.network_4G_only : R.string.network_lte_only);
|
+ ? R.string.network_4G_only : R.string.network_lte_only);
|
||||||
|
+ } else {
|
||||||
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
+ }
|
||||||
+ break;
|
+ break;
|
||||||
default:
|
case Phone.NT_MODE_LTE_WCDMA:
|
||||||
String errMsg = "Invalid Network Mode (" + NetworkMode + "). Ignore.";
|
if (!mIsGlobalCdma) {
|
||||||
loge(errMsg);
|
mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
||||||
|
- ? R.string.network_4G : R.string.network_lte);
|
||||||
|
+ ? R.string.network_3G_4G_only : R.string.network_3G_lte_only);
|
||||||
|
} else {
|
||||||
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
||||||
|
}
|
||||||
--
|
--
|
||||||
2.20.1
|
2.20.1
|
||||||
|
|
@ -135,7 +135,8 @@ enterAndClear "packages/inputmethods/LatinIME";
|
|||||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
||||||
|
|
||||||
enterAndClear "packages/services/Telephony";
|
enterAndClear "packages/services/Telephony";
|
||||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-More_Preferred_Network_Modes.patch";
|
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-PREREQ_Handle_All_Modes.patch";
|
||||||
|
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0002-More_Preferred_Network_Modes.patch";
|
||||||
|
|
||||||
enterAndClear "system/bt";
|
enterAndClear "system/bt";
|
||||||
patch -p1 < "$DOS_PATCHES/android_system_bt/0001-Improve_Quality.patch"; #Improve Bluetooth audio quality, credit @ValdikSS
|
patch -p1 < "$DOS_PATCHES/android_system_bt/0001-Improve_Quality.patch"; #Improve Bluetooth audio quality, credit @ValdikSS
|
||||||
|
@ -134,7 +134,8 @@ enterAndClear "packages/inputmethods/LatinIME";
|
|||||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
||||||
|
|
||||||
enterAndClear "packages/services/Telephony";
|
enterAndClear "packages/services/Telephony";
|
||||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-More_Preferred_Network_Modes.patch";
|
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-PREREQ_Handle_All_Modes.patch";
|
||||||
|
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0002-More_Preferred_Network_Modes.patch";
|
||||||
|
|
||||||
enterAndClear "system/bt";
|
enterAndClear "system/bt";
|
||||||
patch -p1 < "$DOS_PATCHES/android_system_bt/0001-Improve_Quality.patch"; #Improve Bluetooth audio quality, credit @ValdikSS
|
patch -p1 < "$DOS_PATCHES/android_system_bt/0001-Improve_Quality.patch"; #Improve Bluetooth audio quality, credit @ValdikSS
|
||||||
|
Loading…
Reference in New Issue
Block a user