Bug 787370 - Part 2/3: add debug messages for SMS-STATUS-REPORT, r=marshall_law
authorVicamo Yang <vyang@mozilla.com>
Mon, 10 Sep 2012 13:56:04 +0800
changeset 104680 3eb1c445608212ff33b9101653591a59a1f2a521
parent 104679 db7ae51b909ded5631b98e002d0ea310711efa26
child 104681 21244f4a873b89c23886889d6780dca74f98adcf
push id14630
push uservyang@mozilla.com
push dateMon, 10 Sep 2012 05:56:17 +0000
treeherdermozilla-inbound@21244f4a873b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarshall_law
bugs787370
milestone18.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 787370 - Part 2/3: add debug messages for SMS-STATUS-REPORT, r=marshall_law
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -2893,17 +2893,17 @@ let RIL = {
       return null;
     }
 
     // An SMS is a string, but we won't read it as such, so let's read the
     // string length and then defer to PDU parsing helper.
     let messageStringLength = Buf.readUint32();
     if (DEBUG) debug("Got new SMS, length " + messageStringLength);
     let message = GsmPDUHelper.readMessage();
-    if (DEBUG) debug(message);
+    if (DEBUG) debug("Got new SMS: " + JSON.stringify(message));
 
     // Read string delimiters. See Buf.readString().
     Buf.readStringDelimiter(length);
 
     return message;
   },
 
   /**
@@ -2953,21 +2953,23 @@ let RIL = {
    * @param length
    *        Length of SMS string in the incoming parcel.
    *
    * @return A failure cause defined in 3GPP 23.040 clause 9.2.3.22.
    */
   _processSmsStatusReport: function _processSmsStatusReport(length) {
     let message = this._processReceivedSms(length);
     if (!message) {
+      if (DEBUG) debug("invalid SMS-STATUS-REPORT");
       return PDU_FCS_UNSPECIFIED;
     }
 
     let options = this._pendingSentSmsMap[message.messageRef];
     if (!options) {
+      if (DEBUG) debug("no pending SMS-SUBMIT message");
       return PDU_FCS_OK;
     }
 
     let status = message.status;
 
     // 3GPP TS 23.040 9.2.3.15 `The MS shall interpret any reserved values as
     // "Service Rejected"(01100011) but shall store them exactly as received.`
     if ((status >= 0x80)
@@ -2980,22 +2982,24 @@ let RIL = {
         || ((status >= PDU_ST_3_RESERVED_BEGIN)
             && (status < PDU_ST_3_SC_SPECIFIC_BEGIN))
         ) {
       status = PDU_ST_3_SERVICE_REJECTED;
     }
 
     // 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 ((status >>> 5) != 0x00) {
+      if (DEBUG) debug("SMS-STATUS-REPORT: delivery failed");
       // It seems unlikely to get a result code for a failure to deliver.
       // Even if, we don't want to do anything with this.
       return PDU_FCS_OK;
     }
 
     if ((options.segmentMaxSeq > 1)
         && (options.segmentSeq < options.segmentMaxSeq)) {
       // Not last segment. Send next segment here.
@@ -3520,16 +3524,17 @@ 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
     if (!options.requestStatusReport) {
       // Status-Report not requested, send next segment here.