diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-27 19:48:49 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-07-27 19:48:49 -0700 |
commit | 6e4cb2a0017c86cf7fbda2640fa81e10e99a406c (patch) | |
tree | ea5e64d3f376492f26ba126392cbc262cd2c553f /telephony | |
parent | 3843b2669bcfa995e60a46a1034404c1116b8ab9 (diff) | |
parent | ecbbecf6c535e7f3e1d072d43766a95aa18ee464 (diff) | |
download | frameworks_base-6e4cb2a0017c86cf7fbda2640fa81e10e99a406c.zip frameworks_base-6e4cb2a0017c86cf7fbda2640fa81e10e99a406c.tar.gz frameworks_base-6e4cb2a0017c86cf7fbda2640fa81e10e99a406c.tar.bz2 |
am ecbbecf6: Merge change 8620 into donut
Merge commit 'ecbbecf6c535e7f3e1d072d43766a95aa18ee464'
* commit 'ecbbecf6c535e7f3e1d072d43766a95aa18ee464':
Fix swapped gsm/cdma function dispatch, and 7bit text fragmentation.
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/SmsMessage.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/telephony/java/android/telephony/SmsMessage.java b/telephony/java/android/telephony/SmsMessage.java index 775b034..fc491d7 100644 --- a/telephony/java/android/telephony/SmsMessage.java +++ b/telephony/java/android/telephony/SmsMessage.java @@ -278,8 +278,8 @@ public class SmsMessage { public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly) { int activePhone = TelephonyManager.getDefault().getPhoneType(); TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ? - com.android.internal.telephony.gsm.SmsMessage.calculateLength(msgBody, use7bitOnly) : - com.android.internal.telephony.cdma.SmsMessage.calculateLength(msgBody, use7bitOnly); + com.android.internal.telephony.cdma.SmsMessage.calculateLength(msgBody, use7bitOnly) : + com.android.internal.telephony.gsm.SmsMessage.calculateLength(msgBody, use7bitOnly); int ret[] = new int[4]; ret[0] = ted.msgCount; ret[1] = ted.codeUnitCount; @@ -299,8 +299,8 @@ public class SmsMessage { public static ArrayList<String> fragmentText(String text) { int activePhone = TelephonyManager.getDefault().getPhoneType(); TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ? - com.android.internal.telephony.gsm.SmsMessage.calculateLength(text, false) : - com.android.internal.telephony.cdma.SmsMessage.calculateLength(text, false); + com.android.internal.telephony.cdma.SmsMessage.calculateLength(text, false) : + 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 @@ -321,11 +321,8 @@ public class SmsMessage { while (pos < textLen) { int nextPos = 0; // Counts code units. if (ted.codeUnitSize == ENCODING_7BIT) { - if (PHONE_TYPE_CDMA == activePhone) { - nextPos = pos + Math.min(limit, textLen - pos); - } else { - nextPos = GsmAlphabet.findGsmSeptetLimitIndex(text, pos, limit); - } + // For multi-segment messages, CDMA 7bit equals GSM 7bit encoding (EMS mode). + nextPos = GsmAlphabet.findGsmSeptetLimitIndex(text, pos, limit); } else { // Assume unicode. nextPos = pos + Math.min(limit / 2, textLen - pos); } |