From 7b7c4fc2fe146d32479ca9bb606da663cd76651c Mon Sep 17 00:00:00 2001 From: Pavel Zhamaitsiak Date: Tue, 12 Apr 2016 14:24:07 -0700 Subject: [PATCH] Consolidate WiFi Calling string resources - move wfcOperatorErrorCodes to CarrierConfig - corresponding error alert and notification messages are moved to the main string.xml and are accessed by index defined in wfcOperatorErrorCodes - make a list of supported SPN formats and use CarrierConfig to define index of appropriate format string Bug: 27170754 Change-Id: I698908157c1022f47a43ef70f03a571f1d0c75da --- core/res/res/values-mcc310-mnc160/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc200/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc210/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc220/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc230/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc240/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc250/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc260/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc270/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc310/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc490/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc660/strings.xml | 38 ------------------- core/res/res/values-mcc310-mnc800/strings.xml | 38 ------------------- core/res/res/values/strings.xml | 17 +++++---- core/res/res/values/symbols.xml | 4 +- .../telephony/CarrierConfigManager.java | 28 +++++++++++++- 16 files changed, 37 insertions(+), 506 deletions(-) delete mode 100644 core/res/res/values-mcc310-mnc160/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc200/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc210/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc220/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc230/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc240/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc250/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc260/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc270/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc310/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc490/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc660/strings.xml delete mode 100644 core/res/res/values-mcc310-mnc800/strings.xml diff --git a/core/res/res/values-mcc310-mnc160/strings.xml b/core/res/res/values-mcc310-mnc160/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc160/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc200/strings.xml b/core/res/res/values-mcc310-mnc200/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc200/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc210/strings.xml b/core/res/res/values-mcc310-mnc210/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc210/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc220/strings.xml b/core/res/res/values-mcc310-mnc220/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc220/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc230/strings.xml b/core/res/res/values-mcc310-mnc230/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc230/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc240/strings.xml b/core/res/res/values-mcc310-mnc240/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc240/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc250/strings.xml b/core/res/res/values-mcc310-mnc250/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc250/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc260/strings.xml b/core/res/res/values-mcc310-mnc260/strings.xml deleted file mode 100644 index dc798775c70f4..0000000000000 --- a/core/res/res/values-mcc310-mnc260/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc270/strings.xml b/core/res/res/values-mcc310-mnc270/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc270/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc310/strings.xml b/core/res/res/values-mcc310-mnc310/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc310/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc490/strings.xml b/core/res/res/values-mcc310-mnc490/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc490/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc660/strings.xml b/core/res/res/values-mcc310-mnc660/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc660/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values-mcc310-mnc800/strings.xml b/core/res/res/values-mcc310-mnc800/strings.xml deleted file mode 100644 index 526d08b45c7ca..0000000000000 --- a/core/res/res/values-mcc310-mnc800/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - REG09 - - - - To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. - - - - Register with your carrier - - - %s Wi-Fi Calling - diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 96731cf33ece7..8d970f0d06e90 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -245,16 +245,19 @@ Wi-Fi Calling - - - + + To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. + - + + Register with your carrier + - %s - - %s + + %s + %s Wi-Fi Calling + Off diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 7eaff7b74d4bb..3c12cfdc530a5 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -771,11 +771,9 @@ - - - + diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index adc7c218799b8..3ee6b163348fd 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -540,6 +540,27 @@ public class CarrierConfigManager { */ public static final String KEY_EDITABLE_WFC_MODE_BOOL = "editable_wfc_mode_bool"; + /** + * List operator-specific error codes and indices of corresponding error strings in + * wfcOperatorErrorAlertMessages and wfcOperatorErrorNotificationMessages. + * + * Example: "REG09|0" specifies error code "REG09" and index "0". This index will be + * used to find alert and notification messages in wfcOperatorErrorAlertMessages and + * wfcOperatorErrorNotificationMessages. + * + * @hide + */ + public static final String KEY_WFC_OPERATOR_ERROR_CODES_STRING_ARRAY = + "wfc_operator_error_codes_string_array"; + + /** + * Indexes of SPN format strings in wfcSpnFormats and wfcDataSpnFormats. + * @hide + */ + public static final String KEY_WFC_SPN_FORMAT_IDX_INT = "wfc_spn_format_idx_int"; + /** @hide */ + public static final String KEY_WFC_DATA_SPN_FORMAT_IDX_INT = "wfc_data_spn_format_idx_int"; + /** * If this is true, the SIM card (through Customer Service Profile EF file) will be able to * prevent manual operator selection. If false, this SIM setting will be ignored and manual @@ -686,8 +707,8 @@ public class CarrierConfigManager { sDefaults.putString(KEY_VVM_DESTINATION_NUMBER_STRING, ""); sDefaults.putInt(KEY_VVM_PORT_NUMBER_INT, 0); sDefaults.putString(KEY_VVM_TYPE_STRING, ""); - sDefaults.putBoolean(KEY_VVM_CELLULAR_DATA_REQUIRED_BOOLEAN,false); - sDefaults.putBoolean(KEY_VVM_PREFETCH_BOOLEAN,true); + sDefaults.putBoolean(KEY_VVM_CELLULAR_DATA_REQUIRED_BOOLEAN, false); + sDefaults.putBoolean(KEY_VVM_PREFETCH_BOOLEAN, true); sDefaults.putString(KEY_CARRIER_VVM_PACKAGE_NAME_STRING, ""); sDefaults.putBoolean(KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL, false); sDefaults.putBoolean(KEY_CI_ACTION_ON_SYS_UPDATE_BOOL, false); @@ -723,6 +744,9 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL, false); sDefaults.putBoolean(KEY_ALLOW_EMERGENCY_VIDEO_CALLS_BOOL, false); sDefaults.putBoolean(KEY_EDITABLE_WFC_MODE_BOOL, true); + sDefaults.putStringArray(KEY_WFC_OPERATOR_ERROR_CODES_STRING_ARRAY, null); + sDefaults.putInt(KEY_WFC_SPN_FORMAT_IDX_INT, 0); + sDefaults.putInt(KEY_WFC_DATA_SPN_FORMAT_IDX_INT, 0); // MMS defaults sDefaults.putBoolean(KEY_MMS_ALIAS_ENABLED_BOOL, false);