Loading config/hiddenapi-greylist.txt +0 −2 Original line number Diff line number Diff line Loading @@ -1546,8 +1546,6 @@ Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->DBG:Z Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->mTranslationTableCDMA:Landroid/util/SparseIntArray; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->mTranslationTableCommon:Landroid/util/SparseIntArray; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->mTranslationTableGSM:Landroid/util/SparseIntArray; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->translate(Ljava/lang/CharSequence;)Ljava/lang/String; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->useCdmaFormatForMoSms()Z Lcom/android/internal/telephony/SmsApplication$SmsApplicationData;->mApplicationName:Ljava/lang/String; Lcom/android/internal/telephony/SmsApplication;->configurePreferredActivity(Landroid/content/pm/PackageManager;Landroid/content/ComponentName;I)V Lcom/android/internal/telephony/SmsApplication;->getApplicationCollection(Landroid/content/Context;)Ljava/util/Collection; Loading telephony/java/android/telephony/SmsManager.java +5 −8 Original line number Diff line number Diff line Loading @@ -567,20 +567,17 @@ public final class SmsManager { } /** * Divide a message text into several fragments, none bigger than * the maximum SMS message size. * Divide a message text into several fragments, none bigger than the maximum SMS message size. * * @param text the original message. Must not be null. * @return an <code>ArrayList</code> of strings that, in order, * comprise the original message * * @throws IllegalArgumentException if text is null * @return an <code>ArrayList</code> of strings that, in order, comprise the original message. * @throws IllegalArgumentException if text is null. */ public ArrayList<String> divideMessage(String text) { if (null == text) { throw new IllegalArgumentException("text is null"); } return SmsMessage.fragmentText(text); return SmsMessage.fragmentText(text, getSubscriptionId()); } /** Loading telephony/java/android/telephony/SmsMessage.java +95 −42 Original line number Diff line number Diff line Loading @@ -337,27 +337,45 @@ public class SmsMessage { */ /** * Calculates the number of SMS's required to encode the message body and * the number of characters remaining until the next message. * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message. * * @param msgBody the message to encode * @param use7bitOnly if true, characters that are not part of the * radio-specific 7-bit encoding are counted as single * space chars. If false, and if the messageBody contains * non-7-bit encodable characters, length is calculated * using a 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's * required, int[1] the number of code units used, and * int[2] is the number of code units remaining until the * next message. int[3] is an indicator of the encoding * code unit size (see the ENCODING_* definitions in SmsConstants) * @param use7bitOnly if true, characters that are not part of the radio-specific 7-bit encoding * are counted as single space chars. If false, and if the messageBody contains non-7-bit * encodable characters, length is calculated using a 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is an indicator of the encoding code unit size (see the ENCODING_* definitions in * SmsConstants). */ public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly) { return calculateLength(msgBody, use7bitOnly, SmsManager.getDefaultSmsSubscriptionId()); } /** * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message. * * @param msgBody the message to encode * @param use7bitOnly if true, characters that are not part of the radio-specific 7-bit encoding * are counted as single space chars. If false, and if the messageBody contains non-7-bit * encodable characters, length is calculated using a 16-bit encoding. * @param subId Subscription to take SMS format. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is an indicator of the encoding code unit size (see the ENCODING_* definitions in * SmsConstants). * @hide */ public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly, int subId) { // this function is for MO SMS TextEncodingDetails ted = (useCdmaFormatForMoSms()) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength(msgBody, use7bitOnly, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength(msgBody, use7bitOnly); TextEncodingDetails ted = useCdmaFormatForMoSms(subId) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength( msgBody, use7bitOnly, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength( msgBody, use7bitOnly); int ret[] = new int[4]; ret[0] = ted.msgCount; ret[1] = ted.codeUnitCount; Loading @@ -367,21 +385,37 @@ public class SmsMessage { } /** * Divide a message text into several fragments, none bigger than * the maximum SMS message text size. * Divide a message text into several fragments, none bigger than the maximum SMS message text * size. * * @param text text, must not be null. * @return an <code>ArrayList</code> of strings that, in order, * comprise the original msg text * * @return an <code>ArrayList</code> of strings that, in order, comprise the original msg text. * @hide */ @UnsupportedAppUsage public static ArrayList<String> fragmentText(String text) { return fragmentText(text, SmsManager.getDefaultSmsSubscriptionId()); } /** * Divide a message text into several fragments, none bigger than the maximum SMS message text * size. * * @param text text, must not be null. * @param subId Subscription to take SMS format. * @return an <code>ArrayList</code> of strings that, in order, comprise the original msg text. * @hide */ public static ArrayList<String> fragmentText(String text, int subId) { // This function is for MO SMS TextEncodingDetails ted = (useCdmaFormatForMoSms()) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength(text, false, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength(text, false); final boolean isCdma = useCdmaFormatForMoSms(subId); TextEncodingDetails ted = isCdma ? com.android.internal.telephony.cdma.SmsMessage.calculateLength( text, false, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength( text, false); // TODO(cleanup): The code here could be rolled into the logic // below cleanly if these MAX_* constants were defined more Loading Loading @@ -427,18 +461,19 @@ public class SmsMessage { String newMsgBody = null; Resources r = Resources.getSystem(); if (r.getBoolean(com.android.internal.R.bool.config_sms_force_7bit_encoding)) { newMsgBody = Sms7BitEncodingTranslator.translate(text); newMsgBody = Sms7BitEncodingTranslator.translate(text, isCdma); } if (TextUtils.isEmpty(newMsgBody)) { newMsgBody = text; } int pos = 0; // Index in code units. int textLen = newMsgBody.length(); ArrayList<String> result = new ArrayList<String>(ted.msgCount); while (pos < textLen) { int nextPos = 0; // Counts code units. if (ted.codeUnitSize == SmsConstants.ENCODING_7BIT) { if (useCdmaFormatForMoSms() && ted.msgCount == 1) { if (isCdma && ted.msgCount == 1) { // For a singleton CDMA message, the encoding must be ASCII... nextPos = pos + Math.min(limit, textLen - pos); } else { Loading @@ -461,25 +496,39 @@ public class SmsMessage { } /** * Calculates the number of SMS's required to encode the message body and * the number of characters remaining until the next message, given the * current encoding. * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message, given the current encoding. * * @param messageBody the message to encode * @param use7bitOnly if true, characters that are not part of the radio * specific (GSM / CDMA) alphabet encoding are converted to as a * single space characters. If false, a messageBody containing * non-GSM or non-CDMA alphabet characters are encoded using * 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's required, int[1] * the number of code units used, and int[2] is the number of code * units remaining until the next message. int[3] is the encoding * type that should be used for the message. * @param use7bitOnly if true, characters that are not part of the radio specific (GSM / CDMA) * alphabet encoding are converted to as a single space characters. If false, a messageBody * containing non-GSM or non-CDMA alphabet characters are encoded using 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is the encoding type that should be used for the message. */ public static int[] calculateLength(String messageBody, boolean use7bitOnly) { return calculateLength((CharSequence)messageBody, use7bitOnly); } /** * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message, given the current encoding. * * @param messageBody the message to encode * @param use7bitOnly if true, characters that are not part of the radio specific (GSM / CDMA) * alphabet encoding are converted to as a single space characters. If false, a messageBody * containing non-GSM or non-CDMA alphabet characters are encoded using 16-bit encoding. * @param subId Subscription to take SMS format. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is the encoding type that should be used for the message. * @hide */ public static int[] calculateLength(String messageBody, boolean use7bitOnly, int subId) { return calculateLength((CharSequence) messageBody, use7bitOnly, subId); } /* * TODO(cleanup): It looks like there is now no useful reason why * apps should generate pdus themselves using these routines, Loading Loading @@ -510,8 +559,12 @@ public class SmsMessage { */ public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, String message, boolean statusReportRequested) { return getSubmitPdu(scAddress, destinationAddress, message, statusReportRequested, SubscriptionManager.getDefaultSmsSubscriptionId()); return getSubmitPdu( scAddress, destinationAddress, message, statusReportRequested, SmsManager.getDefaultSmsSubscriptionId()); } /** Loading Loading @@ -834,7 +887,7 @@ public class SmsMessage { @UnsupportedAppUsage private static boolean useCdmaFormatForMoSms() { // IMS is registered with SMS support, check the SMS format supported return useCdmaFormatForMoSms(SubscriptionManager.getDefaultSmsSubscriptionId()); return useCdmaFormatForMoSms(SmsManager.getDefaultSmsSubscriptionId()); } /** Loading Loading @@ -863,7 +916,7 @@ public class SmsMessage { * @return true if current phone type is cdma, false otherwise. */ private static boolean isCdmaVoice() { return isCdmaVoice(SubscriptionManager.getDefaultSmsSubscriptionId()); return isCdmaVoice(SmsManager.getDefaultSmsSubscriptionId()); } /** Loading telephony/java/com/android/internal/telephony/GsmAlphabet.java +0 −1 Original line number Diff line number Diff line Loading @@ -868,7 +868,6 @@ public class GsmAlphabet { ted.msgCount = 1; ted.codeUnitsRemaining = SmsConstants.MAX_USER_DATA_SEPTETS - septets; } ted.codeUnitSize = SmsConstants.ENCODING_7BIT; return ted; } Loading telephony/java/com/android/internal/telephony/Sms7BitEncodingTranslator.java +6 −20 Original line number Diff line number Diff line Loading @@ -47,17 +47,14 @@ public class Sms7BitEncodingTranslator { private static final String XML_TO_TAG = "to"; /** * Translates each message character that is not supported by GSM 7bit * alphabet into a supported one * Translates each message character that is not supported by GSM 7bit alphabet into a supported * one. * * @param message * message to be translated * @param throwsException * if true and some error occurs during translation, an exception * is thrown; otherwise a null String is returned * @return translated message or null if some error occur * @param message message to be translated. * @param isCdmaFormat true if cdma format should be used. * @return translated message or null if some error occur. */ public static String translate(CharSequence message) { public static String translate(CharSequence message, boolean isCdmaFormat) { if (message == null) { Rlog.w(TAG, "Null message can not be translated"); return null; Loading @@ -80,7 +77,6 @@ public class Sms7BitEncodingTranslator { (mTranslationTableGSM != null && mTranslationTableGSM.size() > 0) || (mTranslationTableCDMA != null && mTranslationTableCDMA.size() > 0)) { char[] output = new char[size]; boolean isCdmaFormat = useCdmaFormatForMoSms(); for (int i = 0; i < size; i++) { output[i] = translateIfNeeded(message.charAt(i), isCdmaFormat); } Loading Loading @@ -159,16 +155,6 @@ public class Sms7BitEncodingTranslator { } } private static boolean useCdmaFormatForMoSms() { if (!SmsManager.getDefault().isImsSmsSupported()) { // use Voice technology to determine SMS format. return TelephonyManager.getDefault().getCurrentPhoneType() == PhoneConstants.PHONE_TYPE_CDMA; } // IMS is registered with SMS support, check the SMS format supported return (SmsConstants.FORMAT_3GPP2.equals(SmsManager.getDefault().getImsSmsFormat())); } /** * Load the whole translation table file from the framework resource * encoded in XML. Loading Loading
config/hiddenapi-greylist.txt +0 −2 Original line number Diff line number Diff line Loading @@ -1546,8 +1546,6 @@ Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->DBG:Z Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->mTranslationTableCDMA:Landroid/util/SparseIntArray; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->mTranslationTableCommon:Landroid/util/SparseIntArray; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->mTranslationTableGSM:Landroid/util/SparseIntArray; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->translate(Ljava/lang/CharSequence;)Ljava/lang/String; Lcom/android/internal/telephony/Sms7BitEncodingTranslator;->useCdmaFormatForMoSms()Z Lcom/android/internal/telephony/SmsApplication$SmsApplicationData;->mApplicationName:Ljava/lang/String; Lcom/android/internal/telephony/SmsApplication;->configurePreferredActivity(Landroid/content/pm/PackageManager;Landroid/content/ComponentName;I)V Lcom/android/internal/telephony/SmsApplication;->getApplicationCollection(Landroid/content/Context;)Ljava/util/Collection; Loading
telephony/java/android/telephony/SmsManager.java +5 −8 Original line number Diff line number Diff line Loading @@ -567,20 +567,17 @@ public final class SmsManager { } /** * Divide a message text into several fragments, none bigger than * the maximum SMS message size. * Divide a message text into several fragments, none bigger than the maximum SMS message size. * * @param text the original message. Must not be null. * @return an <code>ArrayList</code> of strings that, in order, * comprise the original message * * @throws IllegalArgumentException if text is null * @return an <code>ArrayList</code> of strings that, in order, comprise the original message. * @throws IllegalArgumentException if text is null. */ public ArrayList<String> divideMessage(String text) { if (null == text) { throw new IllegalArgumentException("text is null"); } return SmsMessage.fragmentText(text); return SmsMessage.fragmentText(text, getSubscriptionId()); } /** Loading
telephony/java/android/telephony/SmsMessage.java +95 −42 Original line number Diff line number Diff line Loading @@ -337,27 +337,45 @@ public class SmsMessage { */ /** * Calculates the number of SMS's required to encode the message body and * the number of characters remaining until the next message. * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message. * * @param msgBody the message to encode * @param use7bitOnly if true, characters that are not part of the * radio-specific 7-bit encoding are counted as single * space chars. If false, and if the messageBody contains * non-7-bit encodable characters, length is calculated * using a 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's * required, int[1] the number of code units used, and * int[2] is the number of code units remaining until the * next message. int[3] is an indicator of the encoding * code unit size (see the ENCODING_* definitions in SmsConstants) * @param use7bitOnly if true, characters that are not part of the radio-specific 7-bit encoding * are counted as single space chars. If false, and if the messageBody contains non-7-bit * encodable characters, length is calculated using a 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is an indicator of the encoding code unit size (see the ENCODING_* definitions in * SmsConstants). */ public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly) { return calculateLength(msgBody, use7bitOnly, SmsManager.getDefaultSmsSubscriptionId()); } /** * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message. * * @param msgBody the message to encode * @param use7bitOnly if true, characters that are not part of the radio-specific 7-bit encoding * are counted as single space chars. If false, and if the messageBody contains non-7-bit * encodable characters, length is calculated using a 16-bit encoding. * @param subId Subscription to take SMS format. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is an indicator of the encoding code unit size (see the ENCODING_* definitions in * SmsConstants). * @hide */ public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly, int subId) { // this function is for MO SMS TextEncodingDetails ted = (useCdmaFormatForMoSms()) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength(msgBody, use7bitOnly, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength(msgBody, use7bitOnly); TextEncodingDetails ted = useCdmaFormatForMoSms(subId) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength( msgBody, use7bitOnly, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength( msgBody, use7bitOnly); int ret[] = new int[4]; ret[0] = ted.msgCount; ret[1] = ted.codeUnitCount; Loading @@ -367,21 +385,37 @@ public class SmsMessage { } /** * Divide a message text into several fragments, none bigger than * the maximum SMS message text size. * Divide a message text into several fragments, none bigger than the maximum SMS message text * size. * * @param text text, must not be null. * @return an <code>ArrayList</code> of strings that, in order, * comprise the original msg text * * @return an <code>ArrayList</code> of strings that, in order, comprise the original msg text. * @hide */ @UnsupportedAppUsage public static ArrayList<String> fragmentText(String text) { return fragmentText(text, SmsManager.getDefaultSmsSubscriptionId()); } /** * Divide a message text into several fragments, none bigger than the maximum SMS message text * size. * * @param text text, must not be null. * @param subId Subscription to take SMS format. * @return an <code>ArrayList</code> of strings that, in order, comprise the original msg text. * @hide */ public static ArrayList<String> fragmentText(String text, int subId) { // This function is for MO SMS TextEncodingDetails ted = (useCdmaFormatForMoSms()) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength(text, false, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength(text, false); final boolean isCdma = useCdmaFormatForMoSms(subId); TextEncodingDetails ted = isCdma ? com.android.internal.telephony.cdma.SmsMessage.calculateLength( text, false, true) : com.android.internal.telephony.gsm.SmsMessage.calculateLength( text, false); // TODO(cleanup): The code here could be rolled into the logic // below cleanly if these MAX_* constants were defined more Loading Loading @@ -427,18 +461,19 @@ public class SmsMessage { String newMsgBody = null; Resources r = Resources.getSystem(); if (r.getBoolean(com.android.internal.R.bool.config_sms_force_7bit_encoding)) { newMsgBody = Sms7BitEncodingTranslator.translate(text); newMsgBody = Sms7BitEncodingTranslator.translate(text, isCdma); } if (TextUtils.isEmpty(newMsgBody)) { newMsgBody = text; } int pos = 0; // Index in code units. int textLen = newMsgBody.length(); ArrayList<String> result = new ArrayList<String>(ted.msgCount); while (pos < textLen) { int nextPos = 0; // Counts code units. if (ted.codeUnitSize == SmsConstants.ENCODING_7BIT) { if (useCdmaFormatForMoSms() && ted.msgCount == 1) { if (isCdma && ted.msgCount == 1) { // For a singleton CDMA message, the encoding must be ASCII... nextPos = pos + Math.min(limit, textLen - pos); } else { Loading @@ -461,25 +496,39 @@ public class SmsMessage { } /** * Calculates the number of SMS's required to encode the message body and * the number of characters remaining until the next message, given the * current encoding. * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message, given the current encoding. * * @param messageBody the message to encode * @param use7bitOnly if true, characters that are not part of the radio * specific (GSM / CDMA) alphabet encoding are converted to as a * single space characters. If false, a messageBody containing * non-GSM or non-CDMA alphabet characters are encoded using * 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's required, int[1] * the number of code units used, and int[2] is the number of code * units remaining until the next message. int[3] is the encoding * type that should be used for the message. * @param use7bitOnly if true, characters that are not part of the radio specific (GSM / CDMA) * alphabet encoding are converted to as a single space characters. If false, a messageBody * containing non-GSM or non-CDMA alphabet characters are encoded using 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is the encoding type that should be used for the message. */ public static int[] calculateLength(String messageBody, boolean use7bitOnly) { return calculateLength((CharSequence)messageBody, use7bitOnly); } /** * Calculates the number of SMS's required to encode the message body and the number of * characters remaining until the next message, given the current encoding. * * @param messageBody the message to encode * @param use7bitOnly if true, characters that are not part of the radio specific (GSM / CDMA) * alphabet encoding are converted to as a single space characters. If false, a messageBody * containing non-GSM or non-CDMA alphabet characters are encoded using 16-bit encoding. * @param subId Subscription to take SMS format. * @return an int[4] with int[0] being the number of SMS's required, int[1] the number of code * units used, and int[2] is the number of code units remaining until the next message. * int[3] is the encoding type that should be used for the message. * @hide */ public static int[] calculateLength(String messageBody, boolean use7bitOnly, int subId) { return calculateLength((CharSequence) messageBody, use7bitOnly, subId); } /* * TODO(cleanup): It looks like there is now no useful reason why * apps should generate pdus themselves using these routines, Loading Loading @@ -510,8 +559,12 @@ public class SmsMessage { */ public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, String message, boolean statusReportRequested) { return getSubmitPdu(scAddress, destinationAddress, message, statusReportRequested, SubscriptionManager.getDefaultSmsSubscriptionId()); return getSubmitPdu( scAddress, destinationAddress, message, statusReportRequested, SmsManager.getDefaultSmsSubscriptionId()); } /** Loading Loading @@ -834,7 +887,7 @@ public class SmsMessage { @UnsupportedAppUsage private static boolean useCdmaFormatForMoSms() { // IMS is registered with SMS support, check the SMS format supported return useCdmaFormatForMoSms(SubscriptionManager.getDefaultSmsSubscriptionId()); return useCdmaFormatForMoSms(SmsManager.getDefaultSmsSubscriptionId()); } /** Loading Loading @@ -863,7 +916,7 @@ public class SmsMessage { * @return true if current phone type is cdma, false otherwise. */ private static boolean isCdmaVoice() { return isCdmaVoice(SubscriptionManager.getDefaultSmsSubscriptionId()); return isCdmaVoice(SmsManager.getDefaultSmsSubscriptionId()); } /** Loading
telephony/java/com/android/internal/telephony/GsmAlphabet.java +0 −1 Original line number Diff line number Diff line Loading @@ -868,7 +868,6 @@ public class GsmAlphabet { ted.msgCount = 1; ted.codeUnitsRemaining = SmsConstants.MAX_USER_DATA_SEPTETS - septets; } ted.codeUnitSize = SmsConstants.ENCODING_7BIT; return ted; } Loading
telephony/java/com/android/internal/telephony/Sms7BitEncodingTranslator.java +6 −20 Original line number Diff line number Diff line Loading @@ -47,17 +47,14 @@ public class Sms7BitEncodingTranslator { private static final String XML_TO_TAG = "to"; /** * Translates each message character that is not supported by GSM 7bit * alphabet into a supported one * Translates each message character that is not supported by GSM 7bit alphabet into a supported * one. * * @param message * message to be translated * @param throwsException * if true and some error occurs during translation, an exception * is thrown; otherwise a null String is returned * @return translated message or null if some error occur * @param message message to be translated. * @param isCdmaFormat true if cdma format should be used. * @return translated message or null if some error occur. */ public static String translate(CharSequence message) { public static String translate(CharSequence message, boolean isCdmaFormat) { if (message == null) { Rlog.w(TAG, "Null message can not be translated"); return null; Loading @@ -80,7 +77,6 @@ public class Sms7BitEncodingTranslator { (mTranslationTableGSM != null && mTranslationTableGSM.size() > 0) || (mTranslationTableCDMA != null && mTranslationTableCDMA.size() > 0)) { char[] output = new char[size]; boolean isCdmaFormat = useCdmaFormatForMoSms(); for (int i = 0; i < size; i++) { output[i] = translateIfNeeded(message.charAt(i), isCdmaFormat); } Loading Loading @@ -159,16 +155,6 @@ public class Sms7BitEncodingTranslator { } } private static boolean useCdmaFormatForMoSms() { if (!SmsManager.getDefault().isImsSmsSupported()) { // use Voice technology to determine SMS format. return TelephonyManager.getDefault().getCurrentPhoneType() == PhoneConstants.PHONE_TYPE_CDMA; } // IMS is registered with SMS support, check the SMS format supported return (SmsConstants.FORMAT_3GPP2.equals(SmsManager.getDefault().getImsSmsFormat())); } /** * Load the whole translation table file from the framework resource * encoded in XML. Loading