Allow fragmentText to be called for singleton CDMA messages.

Corrects for previous partner changes, addressing issue:

http://buganizer/issue?id=2063332

Change-Id: I49e564d81c5db3e92a6bad973f21a02a7302875d
This commit is contained in:
Tammo Spalink
2009-08-28 17:00:36 +08:00
parent 33567c5f3d
commit 95434bfaee
3 changed files with 45 additions and 2 deletions

View File

@@ -309,8 +309,13 @@ public class SmsMessage {
while (pos < textLen) {
int nextPos = 0; // Counts code units.
if (ted.codeUnitSize == ENCODING_7BIT) {
// For multi-segment messages, CDMA 7bit equals GSM 7bit encoding (EMS mode).
nextPos = GsmAlphabet.findGsmSeptetLimitIndex(text, pos, limit);
if (activePhone == PHONE_TYPE_CDMA && ted.msgCount == 1) {
// For a singleton CDMA message, the encoding must be ASCII...
nextPos = pos + Math.min(limit, textLen - pos);
} else {
// 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);
}

View File

@@ -116,6 +116,16 @@ public abstract class SmsMessageBase {
* android.telephony.SmsMessage ENCODING_*).
*/
public int codeUnitSize;
@Override
public String toString() {
return "TextEncodingDetails " +
"{ msgCount=" + msgCount +
", codeUnitCount=" + codeUnitCount +
", codeUnitsRemaining=" + codeUnitsRemaining +
", codeUnitSize=" + codeUnitSize +
" }";
}
}
// TODO(): This class is duplicated in SmsMessage.java. Refactor accordingly.