Bug 819937: fix multiple sms-delivery messages sent. r=yhuang
authorVicamo Yang <vyang@mozilla.com>
Fri, 11 Jan 2013 00:49:12 +0800
changeset 118432 16cb74a835b03181c266d5fb1a4127ef8efcfc05
parent 118431 e3c0acf418e9f736c72465bd2803820d826c2fc7
child 118433 c3c55730918250b8551e727a30a7e3646f41cb7c
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersyhuang
bugs819937
milestone21.0a1
Bug 819937: fix multiple sms-delivery messages sent. r=yhuang
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -3593,22 +3593,16 @@ let RIL = {
     // Pending. Waiting for next status report.
     if ((status >>> 5) == 0x01) {
       if (DEBUG) debug("SMS-STATUS-REPORT: delivery still pending");
       return PDU_FCS_OK;
     }
 
     delete this._pendingSentSmsMap[message.messageRef];
 
-    if ((options.segmentMaxSeq > 1)
-        && (options.segmentSeq < options.segmentMaxSeq)) {
-      // Not the last segment.
-      return PDU_FCS_OK;
-    }
-
     let deliveryStatus = ((status >>> 5) == 0x00)
                        ? GECKO_SMS_DELIVERY_STATUS_SUCCESS
                        : GECKO_SMS_DELIVERY_STATUS_ERROR;
     this.sendDOMMessage({
       rilMessageType: "sms-delivery",
       envelopeId: options.envelopeId,
       deliveryStatus: deliveryStatus
     });
@@ -4404,27 +4398,27 @@ RIL[REQUEST_SEND_SMS] = function REQUEST
     }
     return;
   }
 
   options.messageRef = Buf.readUint32();
   options.ackPDU = Buf.readString();
   options.errorCode = Buf.readUint32();
 
-  if (options.requestStatusReport) {
-    if (DEBUG) debug("waiting SMS-STATUS-REPORT for messageRef " + options.messageRef);
-    this._pendingSentSmsMap[options.messageRef] = options;
-  }
-
   if ((options.segmentMaxSeq > 1)
       && (options.segmentSeq < options.segmentMaxSeq)) {
     // Not last segment
     this._processSentSmsSegment(options);
   } else {
-    // Last segment sent with success. Report it.
+    // Last segment sent with success.
+    if (options.requestStatusReport) {
+      if (DEBUG) debug("waiting SMS-STATUS-REPORT for messageRef " + options.messageRef);
+      this._pendingSentSmsMap[options.messageRef] = options;
+    }
+
     this.sendDOMMessage({
       rilMessageType: "sms-sent",
       envelopeId: options.envelopeId,
     });
   }
 };
 RIL[REQUEST_SEND_SMS_EXPECT_MORE] = null;