summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSungmin Choi <sungmin.choi@lge.com>2015-09-25 21:20:12 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-25 21:20:12 +0000
commit5cd1d120196fd26a8110e4bc746a2df7a898c5de (patch)
treed94a071c69525e675e17f6e2be340d928ba5b012
parent98fcc5bfb4d54ffd2c26d914e2b3ea5fe23b914b (diff)
parent49c656dec91e46beb37886564615b97fcad2e677 (diff)
downloadandroid_packages_services_Telephony-5cd1d120196fd26a8110e4bc746a2df7a898c5de.tar.gz
android_packages_services_Telephony-5cd1d120196fd26a8110e4bc746a2df7a898c5de.tar.bz2
android_packages_services_Telephony-5cd1d120196fd26a8110e4bc746a2df7a898c5de.zip
am 49c656de: am 6fc016e6: Enable TDSCDMA mode when connecting CMCC roaming network
* commit '49c656dec91e46beb37886564615b97fcad2e677': Enable TDSCDMA mode when connecting CMCC roaming network
-rw-r--r--res/values-mcc454-mnc12/config.xml25
-rw-r--r--res/values-mcc454-mnc13/config.xml25
-rw-r--r--res/values/config.xml3
-rw-r--r--src/com/android/phone/MobileNetworkSettings.java22
4 files changed, 73 insertions, 2 deletions
diff --git a/res/values-mcc454-mnc12/config.xml b/res/values-mcc454-mnc12/config.xml
new file mode 100644
index 000000000..43294025c
--- /dev/null
+++ b/res/values-mcc454-mnc12/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <!-- Show enabled tdscdma option for device when connect roaming network -->
+ <string-array name="config_support_tdscdma_roaming_on_networks" translatable="false">
+ <item>46000</item>
+ <item>46002</item>
+ <item>46007</item>
+ <item>46008</item>
+ </string-array>
+</resources>
diff --git a/res/values-mcc454-mnc13/config.xml b/res/values-mcc454-mnc13/config.xml
new file mode 100644
index 000000000..43294025c
--- /dev/null
+++ b/res/values-mcc454-mnc13/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <!-- Show enabled tdscdma option for device when connect roaming network -->
+ <string-array name="config_support_tdscdma_roaming_on_networks" translatable="false">
+ <item>46000</item>
+ <item>46002</item>
+ <item>46007</item>
+ <item>46008</item>
+ </string-array>
+</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 617349952..139fb712c 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -140,6 +140,9 @@
<bool name="config_enabled_lte" translatable="false">false</bool>
<!-- Show enabled tdscdma option for device -->
<bool name="config_support_tdscdma" translatable="false">false</bool>
+ <!-- Show enabled tdscdma option for device when connect roaming network -->
+ <string-array name="config_support_tdscdma_roaming_on_networks" translatable="false">
+ </string-array>
<!-- Show cdma auto network mode in (glabal) roaming -->
<!-- DEPRECATED: Use CarrierConfigManager#KEY_SHOW_CDMA_CHOICES_BOOL -->
<bool name="config_show_cdma" translatable="false">false</bool>
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 1d8ceb0e4..aa782045b 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -627,7 +627,7 @@ public class MobileNetworkSettings extends PreferenceActivity
mGsmUmtsOptions = null;
}
} else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
- if (getResources().getBoolean(R.bool.config_support_tdscdma)) {
+ if (isSupportTdscdma()) {
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_tdscdma_choices);
mButtonEnabledNetworks.setEntryValues(
@@ -1167,7 +1167,7 @@ public class MobileNetworkSettings extends PreferenceActivity
case Phone.NT_MODE_LTE_TDSCDMA_WCDMA:
case Phone.NT_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
- if (getResources().getBoolean(R.bool.config_support_tdscdma)) {
+ if (isSupportTdscdma()) {
mButtonEnabledNetworks.setValue(
Integer.toString(Phone.NT_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA));
mButtonEnabledNetworks.setSummary(R.string.network_lte);
@@ -1313,4 +1313,22 @@ public class MobileNetworkSettings extends PreferenceActivity
}
}
+ private boolean isSupportTdscdma() {
+ if (getResources().getBoolean(R.bool.config_support_tdscdma)) {
+ return true;
+ }
+
+ String operatorNumeric = mPhone.getServiceState().getOperatorNumeric();
+ String[] numericArray = getResources().getStringArray(
+ R.array.config_support_tdscdma_roaming_on_networks);
+ if (numericArray.length == 0 || operatorNumeric == null) {
+ return false;
+ }
+ for (String numeric : numericArray) {
+ if (operatorNumeric.equals(numeric)) {
+ return true;
+ }
+ }
+ return false;
+ }
}