diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-02-26 09:24:22 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-02-26 09:24:22 +0000 |
commit | 2f5f6c1432de001c993e0e43daaccec2c2e0bec8 (patch) | |
tree | 2e53060bdd67b8cfca417478d0b908dc4c7c49df | |
parent | 52d98103fe613905ca6e10c783aa1061d89738d6 (diff) | |
parent | 42f3a3f7a4751b3cffb79640d59bd8a30099633f (diff) | |
download | Telephony-pie-b4s4-release.tar.gz |
Merge cherrypicks of [6541047, 6541028, 6541180, 6540905] into pi-b4s4-releaseandroid-9.0.0_r39pie-b4s4-release
Change-Id: I8e80f71d77501148d316fbc89ecedbbf057917b9
-rw-r--r-- | res/values-mcc204-mnc04/strings.xml | 2 | ||||
-rw-r--r-- | res/values-mcc311-mnc220/strings.xml | 20 | ||||
-rw-r--r-- | res/values-mcc311-mnc225/strings.xml | 20 | ||||
-rw-r--r-- | res/values-mcc311-mnc580/strings.xml | 20 | ||||
-rw-r--r-- | res/values/strings.xml | 4 | ||||
-rw-r--r-- | src/com/android/phone/MobileNetworkSettings.java | 52 |
6 files changed, 114 insertions, 4 deletions
diff --git a/res/values-mcc204-mnc04/strings.xml b/res/values-mcc204-mnc04/strings.xml index fec694f48..9708836fc 100644 --- a/res/values-mcc204-mnc04/strings.xml +++ b/res/values-mcc204-mnc04/strings.xml @@ -16,4 +16,6 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string translatable="false" name="config_world_mode">true;BAE0000000000000</string> + <string translatable="false" name="config_world_mode_spn">true;U.S. CELLULAR</string> + <string translatable="false" name="config_show_gsm_option">true;U.S. CELLULAR</string> </resources> diff --git a/res/values-mcc311-mnc220/strings.xml b/res/values-mcc311-mnc220/strings.xml new file mode 100644 index 000000000..52ba286f1 --- /dev/null +++ b/res/values-mcc311-mnc220/strings.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string translatable="false" name="config_world_mode">true</string> + <string translatable="false" name="config_show_gsm_option">true</string> +</resources> diff --git a/res/values-mcc311-mnc225/strings.xml b/res/values-mcc311-mnc225/strings.xml new file mode 100644 index 000000000..52ba286f1 --- /dev/null +++ b/res/values-mcc311-mnc225/strings.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string translatable="false" name="config_world_mode">true</string> + <string translatable="false" name="config_show_gsm_option">true</string> +</resources> diff --git a/res/values-mcc311-mnc580/strings.xml b/res/values-mcc311-mnc580/strings.xml new file mode 100644 index 000000000..52ba286f1 --- /dev/null +++ b/res/values-mcc311-mnc580/strings.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string translatable="false" name="config_world_mode">true</string> + <string translatable="false" name="config_show_gsm_option">true</string> +</resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index 905352095..62c03ca54 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1797,4 +1797,8 @@ <!-- Message displayed to the user to indicate that a held call has been released / disconnected. --> <string name="supp_service_held_call_released">Held call has been released.</string> + <!-- Configuration setting for world mode Format is <true;SPN if any to be checked>--> + <string translatable="false" name="config_world_mode_spn">false</string> + <!-- Configuration setting for mobile network settings show network option by phoneType. Format is <true;SPN if any to be checked>--> + <string translatable="false" name="config_show_gsm_option">false</string> </resources> diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java index f128f9a98..745a7ff9d 100644 --- a/src/com/android/phone/MobileNetworkSettings.java +++ b/src/com/android/phone/MobileNetworkSettings.java @@ -1708,7 +1708,12 @@ public class MobileNetworkSettings extends Activity { } else { if (isWorldMode()) { controlCdmaOptions(true); - controlGsmOptions(false); + if (showNetworkOptionByPhoneType() + && mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM) { + controlGsmOptions(true); + } else { + controlGsmOptions(false); + } } mButtonEnabledNetworks.setValue( Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA)); @@ -1931,20 +1936,59 @@ public class MobileNetworkSettings extends Activity { return super.onOptionsItemSelected(item); } + private boolean showNetworkOptionByPhoneType() { + boolean showByPhoneType = false; + final String configString = getResources().getString( + R.string.config_show_gsm_option); + + if (!TextUtils.isEmpty(configString)) { + String[] configArray = configString.split(";"); + // Check if we have showNetworkOptionByPhoneType configuration set to True only + // or config is set to True and SIM SPN value is also set and matches to the + // current SIM SPN. + if (configArray != null && ( + (configArray.length == 1 && configArray[0].equalsIgnoreCase("true")) + || (configArray.length == 2 && !TextUtils.isEmpty(configArray[1]) + && mTelephonyManager != null + && configArray[1].equalsIgnoreCase( + mTelephonyManager.getSimOperatorName())))) { + showByPhoneType = true; + } + } + Log.d(LOG_TAG, "showNetworkOptionByPhoneType=" + showByPhoneType); + + return showByPhoneType; + } + private boolean isWorldMode() { boolean worldModeOn = false; final String configString = getResources().getString(R.string.config_world_mode); + final String configStringSpn = getResources().getString(R.string.config_world_mode_spn); if (!TextUtils.isEmpty(configString)) { String[] configArray = configString.split(";"); - // Check if we have World mode configuration set to True only or config is set to True - // and SIM GID value is also set and matches to the current SIM GID. + // Check if we have World mode configuration set to True only or config is set to + // True and SIM GID value is also set and matches to the current SIM GID. if (configArray != null && ((configArray.length == 1 && configArray[0].equalsIgnoreCase("true")) || (configArray.length == 2 && !TextUtils.isEmpty(configArray[1]) && mTelephonyManager != null && configArray[1].equalsIgnoreCase( - mTelephonyManager.getGroupIdLevel1())))) { + mTelephonyManager.getGroupIdLevel1())))) { + worldModeOn = true; + } + } + if (!worldModeOn && !TextUtils.isEmpty(configStringSpn)) { + String[] configArray = configStringSpn.split(";"); + // Check if we have World mode configuration set to True only or config is set to + // True and SIM SPN value is also set and matches to the current SIM SPN. + if (configArray != null + && configArray.length == 2 && !TextUtils.isEmpty(configArray[0]) + && !TextUtils.isEmpty(configArray[1]) + && configArray[0].equalsIgnoreCase("true") + && mTelephonyManager != null + && configArray[1].equalsIgnoreCase( + mTelephonyManager.getSimOperatorName())) { worldModeOn = true; } } |