Bug 736706 - Part 2: Handle Message Class 0, r=philikon
authorVicamo Yang <vyang@mozilla.com>
Wed, 26 Sep 2012 14:56:15 +0800
changeset 108114 73d41a3aa7d980061a1bacd6ac481ede0b775b1b
parent 108113 37ef7ce25b9ccbee3d2e646604c1ac5e614bfb77
child 108115 e814f7254496ad7a424d8585f574052724380b30
push id23539
push userryanvm@gmail.com
push dateWed, 26 Sep 2012 22:55:55 +0000
treeherderautoland@ec079fd92224 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilikon
bugs736706
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 736706 - Part 2: Handle Message Class 0, r=philikon
dom/system/gonk/RadioInterfaceLayer.js
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -999,19 +999,22 @@ RadioInterfaceLayer.prototype = {
     let mwi = message.mwi;
     if (mwi) {
       mwi.returnNumber = message.sender || null;
       mwi.returnMessage = message.fullBody || null;
       ppmm.broadcastAsyncMessage("RIL:VoicemailNotification", mwi);
       return;
     }
 
-    let id = gSmsDatabaseService.saveReceivedMessage(message.sender || null,
-                                                     message.fullBody || null,
-                                                     message.timestamp);
+    let id = -1;
+    if (message.messageClass != RIL.PDU_DCS_MSG_CLASS_0) {
+      id = gSmsDatabaseService.saveReceivedMessage(message.sender || null,
+                                                   message.fullBody || null,
+                                                   message.timestamp);
+    }
     let sms = gSmsService.createSmsMessage(id,
                                            DOM_SMS_DELIVERY_RECEIVED,
                                            message.sender || null,
                                            message.receiver || null,
                                            message.fullBody || null,
                                            message.timestamp,
                                            false);
 
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -3079,16 +3079,25 @@ let RIL = {
 
     if (message.epid == PDU_PID_SHORT_MESSAGE_TYPE_0) {
       // `A short message type 0 indicates that the ME must acknowledge receipt
       // of the short message but shall discard its contents.` ~ 3GPP TS 23.040
       // 9.2.3.9
       return PDU_FCS_OK;
     }
 
+    // TODO: Bug 739143: B2G SMS: Support SMS Storage Full event
+    if ((message.messageClass != PDU_DCS_MSG_CLASS_0) && !true) {
+      // `When a mobile terminated message is class 0..., the MS shall display
+      // the message immediately and send a ACK to the SC ..., irrespective of
+      // whether there is memory available in the (U)SIM or ME.` ~ 3GPP 23.038
+      // clause 4.
+      return PDU_FCS_UNSPECIFIED;
+    }
+
     if (message.header && (message.header.segmentMaxSeq > 1)) {
       message = this._processReceivedSmsSegment(message);
     } else {
       if (message.encoding == PDU_DCS_MSG_CODING_8BITS_ALPHABET) {
         message.fullData = message.data;
         delete message.data;
       } else {
         message.fullBody = message.body;