Bug 1197667 - [NetworkManager] Part 1: add missing implementation for 'allNetworkInfo'. r=echen
authorJessica Jong <jjong@mozilla.com>
Thu, 10 Sep 2015 14:50:19 +0800
changeset 294233 115f1a4faea667fb4519ff484ba14c3ca2e9972e
parent 294232 38ce7187402df76b45e60fb6f7e7c54661adb6db
child 294234 ab2b5214e3256f9ad018305c3c09d0913019688b
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1197667
milestone43.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 1197667 - [NetworkManager] Part 1: add missing implementation for 'allNetworkInfo'. r=echen
dom/system/gonk/NetworkManager.js
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -481,16 +481,28 @@ NetworkManager.prototype = {
   },
 
   _manageOfflineStatus: true,
 
   networkInterfaces: null,
 
   networkInterfaceLinks: null,
 
+  get allNetworkInfo() {
+    let allNetworkInfo = {};
+
+    for (let networkId in this.networkInterfaces) {
+      if (this.networkInterfaces.hasOwnProperty(networkId)) {
+        allNetworkInfo[networkId] = this.networkInterfaces[networkId].info;
+      }
+    }
+
+    return allNetworkInfo;
+  },
+
   _preferredNetworkType: DEFAULT_PREFERRED_NETWORK_TYPE,
   get preferredNetworkType() {
     return this._preferredNetworkType;
   },
   set preferredNetworkType(val) {
     if ([Ci.nsINetworkInfo.NETWORK_TYPE_WIFI,
          Ci.nsINetworkInfo.NETWORK_TYPE_MOBILE].indexOf(val) == -1) {
       throw "Invalid network type";