зеркало из https://github.com/mozilla/gecko-dev.git
Bug 872219 - 1/2: B2G SMS - check number of segments in getSegmentInfoForText(). r=gene
This commit is contained in:
Родитель
6e18f16253
Коммит
49bc6af800
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче