Bug 819937: fix multiple sms-delivery messages sent. r=yhuang
authorVicamo Yang <vyang@mozilla.com>
Fri, 11 Jan 2013 00:49:12 +0800
changeset 118407 16cb74a835b03181c266d5fb1a4127ef8efcfc05
parent 118406 e3c0acf418e9f736c72465bd2803820d826c2fc7
child 118408 c3c55730918250b8551e727a30a7e3646f41cb7c
push id21042
push uservyang@mozilla.com
push dateThu, 10 Jan 2013 16:49:19 +0000
treeherdermozilla-inbound@16cb74a835b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyhuang
bugs819937
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;