From 43eb8a97e7638c4f4e529ae9b9d22132400b8fe1 Mon Sep 17 00:00:00 2001 From: Xia Ying Date: Tue, 5 Aug 2014 16:37:18 -0500 Subject: [PATCH] Sms7BitEncodingTranslator Bug: 16197894 Change-Id: I2bd5ae0a3c2d5d8f869f5e2de7009fd450070521 --- core/res/res/values/config.xml | 2 + core/res/res/values/symbols.xml | 2 + .../res/xml/sms_7bit_translation_table.xml | 271 ++++++++++++++++++ .../internal/telephony/GsmAlphabet.java | 12 + 4 files changed, 287 insertions(+) create mode 100644 core/res/res/xml/sms_7bit_translation_table.xml diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 4be9370e9d360..190d601eab407 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 --> true + + false diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 081f8ae23c8b1..2a9e1d1eb913f 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1333,6 +1333,7 @@ + @@ -2070,4 +2071,5 @@ + 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 0000000000000..a63792d5bdd46 --- /dev/null +++ b/core/res/res/xml/sms_7bit_translation_table.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 d1c8ef041d7b2..ef39a6c263897 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