Bug 777145 - Part 1: B2G Network Manager: support navigator.onLine / online / offline events. r=philikon
authorHubert Figuière <hfiguiere@mozilla.com>
Wed, 19 Sep 2012 15:51:21 -0700
changeset 107604 2e21fddbc007e68699c2978fa0d061e21d93c247
parent 107603 b38892f8e7287aa66db328c17fbc8909600fa530
child 107605 2c8cb9b79705e0c4aa3edd26e8131b0f25f2f35f
push id23498
push userryanvm@gmail.com
push dateFri, 21 Sep 2012 01:27:06 +0000
treeherdermozilla-central@488beb32bca5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilikon
bugs777145
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 777145 - Part 1: B2G Network Manager: support navigator.onLine / online / offline events. r=philikon
dom/system/gonk/NetworkManager.js
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -348,16 +348,17 @@ NetworkManager.prototype = {
       // Don't set default route and DNS on secondary APN
       if (oldActive &&
           (oldActive.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS ||
           oldActive.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL)) {
         return;
       }
       this.setDefaultRouteAndDNS(oldActive);
     }
+    Services.io.offline = !this.active;
   },
 
   setDefaultRouteAndDNS: function setDefaultRouteAndDNS(oldInterface) {
     debug("Going to change route and DNS to " + this.active.name);
     let options = {
       cmd: this.active.dhcp ? "runDHCPAndSetDefaultRouteAndDNS" : "setDefaultRouteAndDNS",
       ifname: this.active.name,
       oldIfname: (oldInterface && oldInterface != this.active) ? oldInterface.name : null