Bug 929864 - B2G DSDS: correctly update RILNetworkInterface when wifi connection changes. f=edgar r=hsinyi
authorJessica Jong <jjong@mozilla.com>
Thu, 24 Oct 2013 02:01:00 +0100
changeset 152632 f0bd0d0d0cd58ba5f6832f2d74afe4cfd9dfeafc
parent 152631 050a28b3ef2fcd05ee560b41a2406809829e3cf5
child 152633 889c170c7ae28295bd4146f9d6072f9d045b2916
push id25554
push usercbook@mozilla.com
push dateTue, 29 Oct 2013 14:15:07 +0000
treeherdermozilla-central@4aefc2ca4861 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs929864
milestone27.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 929864 - B2G DSDS: correctly update RILNetworkInterface when wifi connection changes. f=edgar r=hsinyi
dom/system/gonk/NetworkManager.js
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -239,17 +239,19 @@ NetworkManager.prototype = {
             // Add extra host route. For example, mms proxy or mmsc.
             this.setExtraHostRoute(network);
             // Remove pre-created default route and let setAndConfigureActive()
             // to set default route only on preferred network
             this.removeDefaultRoute(network.name);
             this.setAndConfigureActive();
             // Update data connection when Wifi connected/disconnected
             if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
-              this.mRIL.getRadioInterface(0).updateRILNetworkInterface();
+              for (let i = 0; i < this.mRIL.numRadioInterfaces; i++) {
+                this.mRIL.getRadioInterface(i).updateRILNetworkInterface();
+              }
             }
 
             this.onConnectionChanged(network);
 
             // Probing the public network accessibility after routing table is ready
             CaptivePortalDetectionHelper.notify(CaptivePortalDetectionHelper.EVENT_CONNECT, this.active);
             break;
           case Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED:
@@ -267,17 +269,19 @@ NetworkManager.prototype = {
             } else if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) {
               this.removeDefaultRoute(network.name);
             }
             // Abort ongoing captive portal detection on the wifi interface
             CaptivePortalDetectionHelper.notify(CaptivePortalDetectionHelper.EVENT_DISCONNECT, network);
             this.setAndConfigureActive();
             // Update data connection when Wifi connected/disconnected
             if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
-              this.mRIL.getRadioInterface(0).updateRILNetworkInterface();
+              for (let i = 0; i < this.mRIL.numRadioInterfaces; i++) {
+                this.mRIL.getRadioInterface(i).updateRILNetworkInterface();
+              }
             }
             break;
         }
         break;
       case TOPIC_INTERFACE_REGISTERED:
         let regNetwork = subject.QueryInterface(Ci.nsINetworkInterface);
         // Add extra host route. For example, mms proxy or mmsc.
         this.setExtraHostRoute(regNetwork);