diff options
| -rw-r--r-- | core/res/res/values/config.xml | 2 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 2 | ||||
| -rw-r--r-- | core/res/res/xml/sms_7bit_translation_table.xml | 271 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/GsmAlphabet.java | 12 |
4 files changed, 287 insertions, 0 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 4be9370..190d601 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1854,4 +1854,6 @@ state changes. Voice radio tech change will always trigger an update of phone object irrespective of this config --> <bool name="config_switch_phone_on_voice_reg_state_change">true</bool> + + <bool name="config_sms_force_7bit_encoding">false</bool> </resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 081f8ae..2a9e1d1 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1333,6 +1333,7 @@ <java-symbol type="xml" name="audio_assets" /> <java-symbol type="xml" name="global_keys" /> <java-symbol type="xml" name="default_zen_mode_config" /> + <java-symbol type="xml" name="sms_7bit_translation_table" /> <java-symbol type="raw" name="color_fade_vert" /> <java-symbol type="raw" name="color_fade_frag" /> @@ -2070,4 +2071,5 @@ <java-symbol type="array" name="networks_not_clear_data" /> <java-symbol type="bool" name="config_switch_phone_on_voice_reg_state_change" /> <java-symbol type="string" name="whichHomeApplicationNamed" /> + <java-symbol type="bool" name="config_sms_force_7bit_encoding" /> </resources> diff --git a/core/res/res/xml/sms_7bit_translation_table.xml b/core/res/res/xml/sms_7bit_translation_table.xml new file mode 100644 index 0000000..a63792d --- /dev/null +++ b/core/res/res/xml/sms_7bit_translation_table.xml @@ -0,0 +1,271 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** 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. +*/ +--> +<SmsEnforce7BitTranslationTable> + <TranslationType Type="common"> + <Character from="0x00C1" to="0x0041"/> + <Character from="0x00C2" to="0x0041"/> + <Character from="0x00C3" to="0x0041"/> + <Character from="0x00CA" to="0x0045"/> + <Character from="0x00CB" to="0x0045"/> + <Character from="0x00CD" to="0x0049"/> + <Character from="0x00CE" to="0x0049"/> + <Character from="0x00CF" to="0x0049"/> + <Character from="0x00D3" to="0x004F"/> + <Character from="0x00D4" to="0x004F"/> + <Character from="0x00D5" to="0x004F"/> + <Character from="0x00D7" to="0x0078"/> + <Character from="0x00DA" to="0x0055"/> + <Character from="0x00DB" to="0x0055"/> + <Character from="0x00E1" to="0x0061"/> + <Character from="0x00E2" to="0x0061"/> + <Character from="0x00E3" to="0x0061"/> + <Character from="0x00EA" to="0x0065"/> + <Character from="0x00EB" to="0x0065"/> + <Character from="0x00ED" to="0x0069"/> + <Character from="0x00EE" to="0x0069"/> + <Character from="0x00EF" to="0x0069"/> + <Character from="0x00F3" to="0x006F"/> + <Character from="0x00F4" to="0x006F"/> + <Character from="0x00F5" to="0x006F"/> + <Character from="0x00FA" to="0x0075"/> + <Character from="0x00FB" to="0x0075"/> + <Character from="0x0104" to="0x0041"/> + <Character from="0x0105" to="0x0061"/> + <Character from="0x0106" to="0x0043"/> + <Character from="0x0107" to="0x0063"/> + <Character from="0x0110" to="0x0044"/> + <Character from="0x0118" to="0x0045"/> + <Character from="0x0119" to="0x0065"/> + <Character from="0x011E" to="0x0047"/> + <Character from="0x011F" to="0x0067"/> + <Character from="0x0131" to="0x0069"/> + <Character from="0x0139" to="0x004C"/> + <Character from="0x013A" to="0x006C"/> + <Character from="0x0141" to="0x004C"/> + <Character from="0x0142" to="0x006C"/> + <Character from="0x0143" to="0x004E"/> + <Character from="0x0144" to="0x006E"/> + <Character from="0x0150" to="0x004F"/> + <Character from="0x0151" to="0x006F"/> + <Character from="0x015A" to="0x0053"/> + <Character from="0x015B" to="0x0073"/> + <Character from="0x015E" to="0x0053"/> + <Character from="0x015F" to="0x0073"/> + <Character from="0x0170" to="0x0055"/> + <Character from="0x0171" to="0x0075"/> + <Character from="0x0179" to="0x005A"/> + <Character from="0x017A" to="0x007A"/> + <Character from="0x017B" to="0x005A"/> + <Character from="0x017C" to="0x007A"/> + <Character from="0x0386" to="0x0041"/> + <Character from="0x0388" to="0x0045"/> + <Character from="0x0389" to="0x0048"/> + <Character from="0x038A" to="0x0049"/> + <Character from="0x038C" to="0x004F"/> + <Character from="0x038E" to="0x0059"/> + <Character from="0x038F" to="0x03A9"/> + <Character from="0x0390" to="0x0049"/> + <Character from="0x0391" to="0x0041"/> + <Character from="0x0392" to="0x0042"/> + <Character from="0x0395" to="0x0045"/> + <Character from="0x0396" to="0x005A"/> + <Character from="0x0397" to="0x0048"/> + <Character from="0x0399" to="0x0049"/> + <Character from="0x039A" to="0x004B"/> + <Character from="0x039C" to="0x004D"/> + <Character from="0x039D" to="0x004E"/> + <Character from="0x039F" to="0x004F"/> + <Character from="0x03A1" to="0x0050"/> + <Character from="0x03A4" to="0x0054"/> + <Character from="0x03A5" to="0x0059"/> + <Character from="0x03A7" to="0x0058"/> + <Character from="0x03AA" to="0x0049"/> + <Character from="0x03AB" to="0x0059"/> + <Character from="0x03AC" to="0x0041"/> + <Character from="0x03AD" to="0x0045"/> + <Character from="0x03AE" to="0x0048"/> + <Character from="0x03AF" to="0x0049"/> + <Character from="0x03B0" to="0x0059"/> + <Character from="0x03B1" to="0x0041"/> + <Character from="0x03B2" to="0x0042"/> + <Character from="0x03B3" to="0x0393"/> + <Character from="0x03B4" to="0x0394"/> + <Character from="0x03B5" to="0x0045"/> + <Character from="0x03B6" to="0x005A"/> + <Character from="0x03B7" to="0x0048"/> + <Character from="0x03B8" to="0x0398"/> + <Character from="0x03B9" to="0x0049"/> + <Character from="0x03BA" to="0x004B"/> + <Character from="0x03BB" to="0x039B"/> + <Character from="0x03BC" to="0x004D"/> + <Character from="0x03BD" to="0x004E"/> + <Character from="0x03BE" to="0x039E"/> + <Character from="0x03BF" to="0x004F"/> + <Character from="0x03C0" to="0x03A0"/> + <Character from="0x03C1" to="0x0050"/> + <Character from="0x03C2" to="0x03A3"/> + <Character from="0x03C3" to="0x03A3"/> + <Character from="0x03C4" to="0x0054"/> + <Character from="0x03C5" to="0x0059"/> + <Character from="0x03C6" to="0x03A6"/> + <Character from="0x03C7" to="0x0058"/> + <Character from="0x03C8" to="0x03A8"/> + <Character from="0x03C9" to="0x03A9"/> + <Character from="0x03CA" to="0x0049"/> + <Character from="0x03CB" to="0x0059"/> + <Character from="0x03CC" to="0x004F"/> + <Character from="0x03CD" to="0x0059"/> + <Character from="0x03CE" to="0x03A9"/> + <Character from="0x2010" to="0x002D"/> + <Character from="0x00D0" to="0x0044"/> + <Character from="0x00DD" to="0x0059"/> + <Character from="0x00FD" to="0x0079"/> + <Character from="0x00FF" to="0x0079"/> + <Character from="0x0100" to="0x0041"/> + <Character from="0x0101" to="0x0061"/> + <Character from="0x010C" to="0x0043"/> + <Character from="0x010D" to="0x0063"/> + <Character from="0x010E" to="0x0044"/> + <Character from="0x010F" to="0x0064"/> + <Character from="0x0111" to="0x0064"/> + <Character from="0x0112" to="0x0045"/> + <Character from="0x0113" to="0x0065"/> + <Character from="0x011A" to="0x0045"/> + <Character from="0x011B" to="0x0065"/> + <Character from="0x012A" to="0x0049"/> + <Character from="0x012B" to="0x0069"/> + <Character from="0x0132" to="0x004A"/> + <Character from="0x0133" to="0x006A"/> + <Character from="0x013D" to="0x004C"/> + <Character from="0x013E" to="0x006C"/> + <Character from="0x0147" to="0x004E"/> + <Character from="0x0148" to="0x006E"/> + <Character from="0x014C" to="0x004F"/> + <Character from="0x014D" to="0x006F"/> + <Character from="0x0152" to="0x004F"/> + <Character from="0x0153" to="0x006F"/> + <Character from="0x0154" to="0x0052"/> + <Character from="0x0155" to="0x0072"/> + <Character from="0x0158" to="0x0052"/> + <Character from="0x0159" to="0x0072"/> + <Character from="0x0160" to="0x0053"/> + <Character from="0x0161" to="0x0073"/> + <Character from="0x0164" to="0x0054"/> + <Character from="0x0165" to="0x0074"/> + <Character from="0x016A" to="0x0055"/> + <Character from="0x016B" to="0x0075"/> + <Character from="0x016E" to="0x0055"/> + <Character from="0x016F" to="0x0075"/> + <Character from="0x0178" to="0x0079"/> + <Character from="0x017D" to="0x005A"/> + <Character from="0x017E" to="0x007A"/> + <Character from="0x0060" to="0x0027"/> + <Character from="0x00A9" to="0x0063"/> + <Character from="0x00AB" to="0x003C"/> + <Character from="0x00AE" to="0x0052"/> + <Character from="0x00AF" to="0x002D"/> + <Character from="0x00B0" to="0x006F"/> + <Character from="0x00BB" to="0x003E"/> + <Character from="0x02DD" to="0x0022"/> + <Character from="0x2013" to="0x002D"/> + <Character from="0x2014" to="0x002D"/> + <Character from="0x201A" to="0x0027"/> + <Character from="0x201C" to="0x0022"/> + <Character from="0x201D" to="0x0022"/> + <Character from="0x201E" to="0x0022"/> + <Character from="0x2020" to="0x002B"/> + <Character from="0x2021" to="0x002B"/> + <Character from="0x2022" to="0x002E"/> + <Character from="0x2026" to="0x002E"/> + <Character from="0x2030" to="0x0025"/> + <Character from="0x2039" to="0x003C"/> + <Character from="0x203A" to="0x003E"/> + <Character from="0x20A3" to="0x0023"/> + <Character from="0x20A4" to="0x0023"/> + <Character from="0x20B1" to="0x0023"/> + <Character from="0x2264" to="0x003C"/> + <Character from="0x2265" to="0x003E"/> + <Character from="0x0102" to="0x0041"/> + <Character from="0x0103" to="0x0061"/> + <Character from="0x0162" to="0x0054"/> + <Character from="0x0163" to="0x0074"/> + </TranslationType> + <TranslationType Type="gsm"> + <Character from="0x00C0" to="0x00E0"/> + <Character from="0x00C8" to="0x00E8"/> + <Character from="0x00CC" to="0x00EC"/> + <Character from="0x00D2" to="0x00F2"/> + <Character from="0x00D9" to="0x00F9"/> + <Character from="0x00E7" to="0x00C7"/> + <Character from="0x00A2" to="0x003F"/> + <Character from="0x00A6" to="0x003F"/> + <Character from="0x00B1" to="0x003F"/> + <Character from="0x00B6" to="0x003F"/> + <Character from="0x00F7" to="0x003F"/> + <Character from="0x0192" to="0x003F"/> + <Character from="0x2122" to="0x003F"/> + <Character from="0x221A" to="0x003F"/> + <Character from="0x221E" to="0x003F"/> + <Character from="0x2248" to="0x003F"/> + <Character from="0x2260" to="0x003F"/> + </TranslationType> + <TranslationType Type="cdma"> + <Character from="0x00A1" to="0x0021"/> + <Character from="0x00BF" to="0x0020"/> + <Character from="0x00C0" to="0x0041"/> + <Character from="0x00C4" to="0x0041"/> + <Character from="0x00C5" to="0x0041"/> + <Character from="0x00C6" to="0x0020"/> + <Character from="0x00C7" to="0x0043"/> + <Character from="0x00C8" to="0x0045"/> + <Character from="0x00C9" to="0x0045"/> + <Character from="0x00CC" to="0x0049"/> + <Character from="0x00D1" to="0x004E"/> + <Character from="0x00D2" to="0x004F"/> + <Character from="0x00D6" to="0x004F"/> + <Character from="0x00D8" to="0x0020"/> + <Character from="0x00D9" to="0x0055"/> + <Character from="0x00DC" to="0x0055"/> + <Character from="0x00DD" to="0x0059"/> + <Character from="0x00DF" to="0x0020"/> + <Character from="0x00E0" to="0x0061"/> + <Character from="0x00E4" to="0x0061"/> + <Character from="0x00E5" to="0x0061"/> + <Character from="0x00E6" to="0x0020"/> + <Character from="0x00E7" to="0x0063"/> + <Character from="0x00E8" to="0x0065"/> + <Character from="0x00E9" to="0x0065"/> + <Character from="0x00EC" to="0x0069"/> + <Character from="0x00F1" to="0x006F"/> + <Character from="0x00F2" to="0x006F"/> + <Character from="0x00F6" to="0x006F"/> + <Character from="0x00F8" to="0x0020"/> + <Character from="0x00F9" to="0x0075"/> + <Character from="0x00FC" to="0x0075"/> + <Character from="0x00A2" to="0x0023"/> + <Character from="0x00A6" to="0x0020"/> + <Character from="0x00B1" to="0x0020"/> + <Character from="0x00B6" to="0x0020"/> + <Character from="0x00F7" to="0x0020"/> + <Character from="0x0192" to="0x0020"/> + <Character from="0x2122" to="0x0020"/> + <Character from="0x221A" to="0x0020"/> + <Character from="0x221E" to="0x0020"/> + <Character from="0x2248" to="0x0020"/> + <Character from="0x2260" to="0x0020"/> + </TranslationType> +</SmsEnforce7BitTranslationTable>
\ No newline at end of file diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java index d1c8ef0..ef39a6c 100644 --- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java +++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java @@ -754,6 +754,18 @@ public class GsmAlphabet { } } + public static boolean isGsmSeptets(char c) { + if (sCharsToGsmTables[0].get(c, -1) != -1) { + return true; + } + + if (sCharsToShiftTables[0].get(c, -1) != -1) { + return true; + } + + return false; + } + /** * Returns the count of 7-bit GSM alphabet characters needed * to represent this string, using the specified 7-bit language table |
