Bug 991988 - Resolve HostName of either MMS Proxy or MMSC. r=vyang, a=1.3+
authorBevis Tseng <btseng@mozilla.com>
Thu, 10 Apr 2014 12:03:56 +0800
changeset 192815 8709b531d4f32303df1e01c66755d6d3bd69f8f7
parent 192814 dff8b2f0d02aab38ada795eaa67feb8bb5b25ad9
child 192816 af721b6137ff313ff8a095527498dd5b362d5cdf
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvyang, 1
bugs991988
milestone30.0a2
Bug 991988 - Resolve HostName of either MMS Proxy or MMSC. r=vyang, a=1.3+
dom/system/gonk/NetworkManager.js
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -468,17 +468,24 @@ NetworkManager.prototype = {
         return;
       }
 
       network = network.QueryInterface(Ci.nsIRilNetworkInterface);
 
       debug("Network '" + network.name + "' registered, " +
             "adding mmsproxy and/or mmsc route");
 
-      let mmsHosts = this.resolveHostname([network.mmsProxy, network.mmsc]);
+      let hostToResolve = network.mmsProxy;
+      // Workaround an xpconnect issue with undefined string objects.
+      // See bug 808220
+      if (!hostToResolve || hostToResolve === "undefined") {
+        hostToResolve = network.mmsc;
+      }
+
+      let mmsHosts = this.resolveHostname([hostToResolve]);
       if (mmsHosts.length == 0) {
         debug("No valid hostnames can be added. Stop adding host route.");
         return;
       }
 
       gNetworkService.addHostRouteWithResolve(network, mmsHosts);
     }
   },
@@ -490,17 +497,24 @@ NetworkManager.prototype = {
         return;
       }
 
       network = network.QueryInterface(Ci.nsIRilNetworkInterface);
 
       debug("Network '" + network.name + "' unregistered, " +
             "removing mmsproxy and/or mmsc route");
 
-      let mmsHosts = this.resolveHostname([network.mmsProxy, network.mmsc]);
+      let hostToResolve = network.mmsProxy;
+      // Workaround an xpconnect issue with undefined string objects.
+      // See bug 808220
+      if (!hostToResolve || hostToResolve === "undefined") {
+        hostToResolve = network.mmsc;
+      }
+
+      let mmsHosts = this.resolveHostname([hostToResolve]);
       if (mmsHosts.length == 0) {
         debug("No valid hostnames can be removed. Stop removing host route.");
         return;
       }
 
       gNetworkService.removeHostRouteWithResolve(network, mmsHosts);
     }
   },