Bug 872219 - 1/2: B2G SMS - check number of segments in getSegmentInfoForText(). r=gene

This commit is contained in:
Vicamo Yang 2013-05-23 19:42:29 +08:00
Родитель 6e18f16253
Коммит 49bc6af800
1 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -2726,11 +2726,16 @@ RadioInterfaceLayer.prototype = {
}
let options = this._fragmentText(text, null, strict7BitEncoding);
let lastSegment = options.segments[options.segmentMaxSeq - 1];
let charsInLastSegment = lastSegment.encodedBodyLength;
if (options.dcs == RIL.PDU_DCS_MSG_CODING_16BITS_ALPHABET) {
// In UCS2 encoding, encodedBodyLength is in octets.
charsInLastSegment /= 2;
let charsInLastSegment;
if (options.segmentMaxSeq) {
let lastSegment = options.segments[options.segmentMaxSeq - 1];
charsInLastSegment = lastSegment.encodedBodyLength;
if (options.dcs == RIL.PDU_DCS_MSG_CODING_16BITS_ALPHABET) {
// In UCS2 encoding, encodedBodyLength is in octets.
charsInLastSegment /= 2;
}
} else {
charsInLastSegment = 0;
}
let result = gMobileMessageService.createSmsSegmentInfo(options.segmentMaxSeq,