Bug 946942 - [MMS] MO/MT MMS fail if the MMS APN is shared with default APN (follow-up). r=anshulj, a=1.3+
authorGene Lian <clian@mozilla.com>
Mon, 09 Dec 2013 11:58:03 +0800
changeset 174224 ee493ea80c8f88caea94165cb7fbc0f332e471a0
parent 174223 0caa220cef77554c3a879270ad1a5fd40537d4e1
child 174225 2e63dfbf36611909639b4181f86a7b789e99a132
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersanshulj, 1
bugs946942
milestone28.0a2
Bug 946942 - [MMS] MO/MT MMS fail if the MMS APN is shared with default APN (follow-up). r=anshulj, a=1.3+
dom/mobilemessage/src/gonk/MmsService.js
--- a/dom/mobilemessage/src/gonk/MmsService.js
+++ b/dom/mobilemessage/src/gonk/MmsService.js
@@ -251,21 +251,23 @@ MmsConnection.prototype = {
     // If the MMS network is connected during the initialization, it means the
     // MMS network must share the same APN with the mobile network by default.
     // Under this case, |networkManager.active| should keep the mobile network,
     // which is supposed be an instance of |nsIRilNetworkInterface| for sure.
     if (this.connected) {
       let networkManager =
         Cc["@mozilla.org/network/manager;1"].getService(Ci.nsINetworkManager);
       let activeNetwork = networkManager.active;
-      if (activeNetwork.serviceId != this.serviceId) {
+
+      let rilNetwork = activeNetwork.QueryInterface(Ci.nsIRilNetworkInterface);
+      if (rilNetwork.serviceId != this.serviceId) {
+        if (DEBUG) debug("Sevice ID between active/MMS network doesn't match.");
         return;
       }
 
-      let rilNetwork = activeNetwork.QueryInterface(Ci.nsIRilNetworkInterface);
       // Set up the MMS APN setting based on the connected MMS network,
       // which is going to be used for the HTTP requests later.
       this.setApnSetting(rilNetwork);
     }
   },
 
   /**
    * Return the roaming status of voice call.