Bug 996409 - Part 1: 'network-active-changed' doesn't be propagated if active becomes to null. r=hsinyi
authorEdgar Chen <echen@mozilla.com>
Fri, 11 Apr 2014 17:30:16 +0800
changeset 179294 fe7d26409026ac7c3fa756d160556eaf82ef1f65
parent 179293 1867403e4fb449b43ca21cac9cb077c0f0289ddf
child 179295 c48e44a0e5d128ba198b7da24ba1876f4bd1d613
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewershsinyi
bugs996409
milestone31.0a1
Bug 996409 - Part 1: 'network-active-changed' doesn't be propagated if active becomes to null. r=hsinyi
dom/system/gonk/NetworkManager.js
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -639,19 +639,20 @@ NetworkManager.prototype = {
       if (this.isNetworkTypeSecondaryMobile(this.active.type)) {
         gNetworkService.setDNS(this.active);
       } else {
 #endif // MOZ_B2G_RIL
         gNetworkService.setDefaultRouteAndDNS(this.active, oldActive);
 #ifdef MOZ_B2G_RIL
       }
 #endif
-      if (this.active != oldActive) {
-        Services.obs.notifyObservers(this.active, TOPIC_ACTIVE_CHANGED, null);
-      }
+    }
+
+    if (this.active != oldActive) {
+      Services.obs.notifyObservers(this.active, TOPIC_ACTIVE_CHANGED, null);
     }
 
     if (this._manageOfflineStatus) {
       Services.io.offline = !this.active;
     }
   },
 
 #ifdef MOZ_B2G_RIL