Loading core/res/res/values-mcc286/config.xml 0 → 100755 +64 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright 2012, 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. */ --> <!-- These resources are around just to allow their values to be customized for different hardware and product builds. DO NOT TRANSLATE. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- National Language Identifier codes for the following two config items. (from 3GPP TS 23.038 V9.1.1 Table 6.2.1.2.4.1): 0 - reserved 1 - Turkish 2 - Spanish (single shift table only) 3 - Portuguese 4 - Bengali 5 - Gujarati 6 - Hindi 7 - Kannada 8 - Malayalam 9 - Oriya 10 - Punjabi 11 - Tamil 12 - Telugu 13 - Urdu 14+ - reserved --> <!-- National language single shift tables to enable for SMS encoding. Decoding is always enabled. 3GPP TS 23.038 states that this feature should not be enabled until a formal request is issued by the relevant national regulatory body. Array elements are codes from the table above. Example 1: devices sold in Turkey must include table 1 to conform with By-Law Number 27230. (http://www.btk.gov.tr/eng/pdf/2009/BY-LAW_SMS.pdf) Example 2: devices sold in India should include tables 4 through 13 to enable use of the new Release 9 tables for Indic languages. --> <integer-array name="config_sms_enabled_single_shift_tables"><item>1</item></integer-array> <!-- National language locking shift tables to enable for SMS encoding. Decoding is always enabled. 3GPP TS 23.038 states that this feature should not be enabled until a formal request is issued by the relevant national regulatory body. Array elements are codes from the table above. Example 1: devices sold in Turkey must include table 1 after the Turkish Telecommunication Authority requires locking shift encoding to be enabled (est. July 2012). (http://www.btk.gov.tr/eng/pdf/2009/BY-LAW_SMS.pdf) See also: http://www.mobitech.com.tr/tr/ersanozturkblog_en/index.php?entry=entry090223-160014 Example 2: devices sold in India should include tables 4 through 13 to enable use of the new Release 9 tables for Indic languages. --> <!-- <integer-array name="config_sms_enabled_locking_shift_tables"></integer-array> --> </resources> telephony/java/com/android/internal/telephony/GsmAlphabet.java +28 −11 Original line number Original line Diff line number Diff line Loading @@ -803,6 +803,10 @@ public class GsmAlphabet { */ */ public static TextEncodingDetails public static TextEncodingDetails countGsmSeptets(CharSequence s, boolean use7bitOnly) { countGsmSeptets(CharSequence s, boolean use7bitOnly) { // Load enabled language tables from config.xml, including any MCC overlays if (!sDisableCountryEncodingCheck) { enableCountrySpecificEncodings(); } // fast path for common case where no national language shift tables are enabled // fast path for common case where no national language shift tables are enabled if (sEnabledSingleShiftTables.length + sEnabledLockingShiftTables.length == 0) { if (sEnabledSingleShiftTables.length + sEnabledLockingShiftTables.length == 0) { TextEncodingDetails ted = new TextEncodingDetails(); TextEncodingDetails ted = new TextEncodingDetails(); Loading Loading @@ -989,6 +993,7 @@ public class GsmAlphabet { */ */ static synchronized void setEnabledSingleShiftTables(int[] tables) { static synchronized void setEnabledSingleShiftTables(int[] tables) { sEnabledSingleShiftTables = tables; sEnabledSingleShiftTables = tables; sDisableCountryEncodingCheck = true; if (tables.length > 0) { if (tables.length > 0) { sHighestEnabledSingleShiftCode = tables[tables.length - 1]; sHighestEnabledSingleShiftCode = tables[tables.length - 1]; Loading @@ -1006,6 +1011,7 @@ public class GsmAlphabet { */ */ static synchronized void setEnabledLockingShiftTables(int[] tables) { static synchronized void setEnabledLockingShiftTables(int[] tables) { sEnabledLockingShiftTables = tables; sEnabledLockingShiftTables = tables; sDisableCountryEncodingCheck = true; } } /** /** Loading @@ -1030,6 +1036,24 @@ public class GsmAlphabet { return sEnabledLockingShiftTables; return sEnabledLockingShiftTables; } } /** * Enable country-specific language tables from MCC-specific overlays. * @context the context to use to get the TelephonyManager */ private static void enableCountrySpecificEncodings() { Resources r = Resources.getSystem(); // See comments in frameworks/base/core/res/res/values/config.xml for allowed values sEnabledSingleShiftTables = r.getIntArray(R.array.config_sms_enabled_single_shift_tables); sEnabledLockingShiftTables = r.getIntArray(R.array.config_sms_enabled_locking_shift_tables); if (sEnabledSingleShiftTables.length > 0) { sHighestEnabledSingleShiftCode = sEnabledSingleShiftTables[sEnabledSingleShiftTables.length-1]; } else { sHighestEnabledSingleShiftCode = 0; } } /** Reverse mapping from Unicode characters to indexes into language tables. */ /** Reverse mapping from Unicode characters to indexes into language tables. */ private static final SparseIntArray[] sCharsToGsmTables; private static final SparseIntArray[] sCharsToGsmTables; Loading @@ -1045,6 +1069,9 @@ public class GsmAlphabet { /** Highest language code to include in array of single shift counters. */ /** Highest language code to include in array of single shift counters. */ private static int sHighestEnabledSingleShiftCode; private static int sHighestEnabledSingleShiftCode; /** Flag to bypass check for country-specific overlays (for test cases only). */ private static boolean sDisableCountryEncodingCheck = false; /** /** * Septet counter for a specific locking shift table and all of * Septet counter for a specific locking shift table and all of * the single shift tables that it can be paired with. * the single shift tables that it can be paired with. Loading Loading @@ -1408,10 +1435,7 @@ public class GsmAlphabet { }; }; static { static { Resources r = Resources.getSystem(); enableCountrySpecificEncodings(); // See comments in frameworks/base/core/res/res/values/config.xml for allowed values sEnabledSingleShiftTables = r.getIntArray(R.array.config_sms_enabled_single_shift_tables); sEnabledLockingShiftTables = r.getIntArray(R.array.config_sms_enabled_locking_shift_tables); int numTables = sLanguageTables.length; int numTables = sLanguageTables.length; int numShiftTables = sLanguageShiftTables.length; int numShiftTables = sLanguageShiftTables.length; if (numTables != numShiftTables) { if (numTables != numShiftTables) { Loading @@ -1419,13 +1443,6 @@ public class GsmAlphabet { " != shift tables array length " + numShiftTables); " != shift tables array length " + numShiftTables); } } if (sEnabledSingleShiftTables.length > 0) { sHighestEnabledSingleShiftCode = sEnabledSingleShiftTables[sEnabledSingleShiftTables.length-1]; } else { sHighestEnabledSingleShiftCode = 0; } sCharsToGsmTables = new SparseIntArray[numTables]; sCharsToGsmTables = new SparseIntArray[numTables]; for (int i = 0; i < numTables; i++) { for (int i = 0; i < numTables; i++) { String table = sLanguageTables[i]; String table = sLanguageTables[i]; Loading Loading
core/res/res/values-mcc286/config.xml 0 → 100755 +64 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright 2012, 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. */ --> <!-- These resources are around just to allow their values to be customized for different hardware and product builds. DO NOT TRANSLATE. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- National Language Identifier codes for the following two config items. (from 3GPP TS 23.038 V9.1.1 Table 6.2.1.2.4.1): 0 - reserved 1 - Turkish 2 - Spanish (single shift table only) 3 - Portuguese 4 - Bengali 5 - Gujarati 6 - Hindi 7 - Kannada 8 - Malayalam 9 - Oriya 10 - Punjabi 11 - Tamil 12 - Telugu 13 - Urdu 14+ - reserved --> <!-- National language single shift tables to enable for SMS encoding. Decoding is always enabled. 3GPP TS 23.038 states that this feature should not be enabled until a formal request is issued by the relevant national regulatory body. Array elements are codes from the table above. Example 1: devices sold in Turkey must include table 1 to conform with By-Law Number 27230. (http://www.btk.gov.tr/eng/pdf/2009/BY-LAW_SMS.pdf) Example 2: devices sold in India should include tables 4 through 13 to enable use of the new Release 9 tables for Indic languages. --> <integer-array name="config_sms_enabled_single_shift_tables"><item>1</item></integer-array> <!-- National language locking shift tables to enable for SMS encoding. Decoding is always enabled. 3GPP TS 23.038 states that this feature should not be enabled until a formal request is issued by the relevant national regulatory body. Array elements are codes from the table above. Example 1: devices sold in Turkey must include table 1 after the Turkish Telecommunication Authority requires locking shift encoding to be enabled (est. July 2012). (http://www.btk.gov.tr/eng/pdf/2009/BY-LAW_SMS.pdf) See also: http://www.mobitech.com.tr/tr/ersanozturkblog_en/index.php?entry=entry090223-160014 Example 2: devices sold in India should include tables 4 through 13 to enable use of the new Release 9 tables for Indic languages. --> <!-- <integer-array name="config_sms_enabled_locking_shift_tables"></integer-array> --> </resources>
telephony/java/com/android/internal/telephony/GsmAlphabet.java +28 −11 Original line number Original line Diff line number Diff line Loading @@ -803,6 +803,10 @@ public class GsmAlphabet { */ */ public static TextEncodingDetails public static TextEncodingDetails countGsmSeptets(CharSequence s, boolean use7bitOnly) { countGsmSeptets(CharSequence s, boolean use7bitOnly) { // Load enabled language tables from config.xml, including any MCC overlays if (!sDisableCountryEncodingCheck) { enableCountrySpecificEncodings(); } // fast path for common case where no national language shift tables are enabled // fast path for common case where no national language shift tables are enabled if (sEnabledSingleShiftTables.length + sEnabledLockingShiftTables.length == 0) { if (sEnabledSingleShiftTables.length + sEnabledLockingShiftTables.length == 0) { TextEncodingDetails ted = new TextEncodingDetails(); TextEncodingDetails ted = new TextEncodingDetails(); Loading Loading @@ -989,6 +993,7 @@ public class GsmAlphabet { */ */ static synchronized void setEnabledSingleShiftTables(int[] tables) { static synchronized void setEnabledSingleShiftTables(int[] tables) { sEnabledSingleShiftTables = tables; sEnabledSingleShiftTables = tables; sDisableCountryEncodingCheck = true; if (tables.length > 0) { if (tables.length > 0) { sHighestEnabledSingleShiftCode = tables[tables.length - 1]; sHighestEnabledSingleShiftCode = tables[tables.length - 1]; Loading @@ -1006,6 +1011,7 @@ public class GsmAlphabet { */ */ static synchronized void setEnabledLockingShiftTables(int[] tables) { static synchronized void setEnabledLockingShiftTables(int[] tables) { sEnabledLockingShiftTables = tables; sEnabledLockingShiftTables = tables; sDisableCountryEncodingCheck = true; } } /** /** Loading @@ -1030,6 +1036,24 @@ public class GsmAlphabet { return sEnabledLockingShiftTables; return sEnabledLockingShiftTables; } } /** * Enable country-specific language tables from MCC-specific overlays. * @context the context to use to get the TelephonyManager */ private static void enableCountrySpecificEncodings() { Resources r = Resources.getSystem(); // See comments in frameworks/base/core/res/res/values/config.xml for allowed values sEnabledSingleShiftTables = r.getIntArray(R.array.config_sms_enabled_single_shift_tables); sEnabledLockingShiftTables = r.getIntArray(R.array.config_sms_enabled_locking_shift_tables); if (sEnabledSingleShiftTables.length > 0) { sHighestEnabledSingleShiftCode = sEnabledSingleShiftTables[sEnabledSingleShiftTables.length-1]; } else { sHighestEnabledSingleShiftCode = 0; } } /** Reverse mapping from Unicode characters to indexes into language tables. */ /** Reverse mapping from Unicode characters to indexes into language tables. */ private static final SparseIntArray[] sCharsToGsmTables; private static final SparseIntArray[] sCharsToGsmTables; Loading @@ -1045,6 +1069,9 @@ public class GsmAlphabet { /** Highest language code to include in array of single shift counters. */ /** Highest language code to include in array of single shift counters. */ private static int sHighestEnabledSingleShiftCode; private static int sHighestEnabledSingleShiftCode; /** Flag to bypass check for country-specific overlays (for test cases only). */ private static boolean sDisableCountryEncodingCheck = false; /** /** * Septet counter for a specific locking shift table and all of * Septet counter for a specific locking shift table and all of * the single shift tables that it can be paired with. * the single shift tables that it can be paired with. Loading Loading @@ -1408,10 +1435,7 @@ public class GsmAlphabet { }; }; static { static { Resources r = Resources.getSystem(); enableCountrySpecificEncodings(); // See comments in frameworks/base/core/res/res/values/config.xml for allowed values sEnabledSingleShiftTables = r.getIntArray(R.array.config_sms_enabled_single_shift_tables); sEnabledLockingShiftTables = r.getIntArray(R.array.config_sms_enabled_locking_shift_tables); int numTables = sLanguageTables.length; int numTables = sLanguageTables.length; int numShiftTables = sLanguageShiftTables.length; int numShiftTables = sLanguageShiftTables.length; if (numTables != numShiftTables) { if (numTables != numShiftTables) { Loading @@ -1419,13 +1443,6 @@ public class GsmAlphabet { " != shift tables array length " + numShiftTables); " != shift tables array length " + numShiftTables); } } if (sEnabledSingleShiftTables.length > 0) { sHighestEnabledSingleShiftCode = sEnabledSingleShiftTables[sEnabledSingleShiftTables.length-1]; } else { sHighestEnabledSingleShiftCode = 0; } sCharsToGsmTables = new SparseIntArray[numTables]; sCharsToGsmTables = new SparseIntArray[numTables]; for (int i = 0; i < numTables; i++) { for (int i = 0; i < numTables; i++) { String table = sLanguageTables[i]; String table = sLanguageTables[i]; Loading