Bug 966925 - Filter scan result based on platform property. r=vchang, a=1.3+
authorChuck Lee <chulee@mozilla.com>
Thu, 20 Mar 2014 14:39:21 +0800
changeset 192542 965dcb2e8059cdfc62c5f438d0e815baddf2dc23
parent 192541 38fc085fa09903bb10d54b1e32c76e3244bcb4c9
child 192543 102de3568ed555eca0f918cdf2c434b84bd757d1
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)
reviewersvchang, 1
bugs966925
milestone30.0a2
Bug 966925 - Filter scan result based on platform property. r=vchang, a=1.3+
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -106,21 +106,27 @@ var WifiManager = (function() {
 
   function getStartupPrefs() {
     return {
       sdkVersion: parseInt(libcutils.property_get("ro.build.version.sdk"), 10),
       unloadDriverEnabled: libcutils.property_get("ro.moz.wifi.unloaddriver") === "1",
       schedScanRecovery: libcutils.property_get("ro.moz.wifi.sched_scan_recover") === "false" ? false : true,
       driverDelay: libcutils.property_get("ro.moz.wifi.driverDelay"),
       p2pSupported: libcutils.property_get("ro.moz.wifi.p2p_supported") === "1",
+      eapSimSupported: libcutils.property_get("ro.moz.wifi.eapsim_supported") === "1",
       ifname: libcutils.property_get("wifi.interface")
     };
   }
 
-  let {sdkVersion, unloadDriverEnabled, schedScanRecovery, driverDelay, p2pSupported, ifname} = getStartupPrefs();
+  let {sdkVersion, unloadDriverEnabled, schedScanRecovery,
+       driverDelay, p2pSupported, eapSimSupported, ifname} = getStartupPrefs();
+
+  let capabilities = {
+    eapSim: eapSimSupported
+  };
 
   let wifiListener = {
     onWaitEvent: function(event, iface) {
       if (manager.ifname === iface && handleEvent(event)) {
         waitForEvent(iface);
       } else if (p2pSupported) {
         if (WifiP2pManager.INTERFACE_NAME === iface) {
           // If the connection is closed, wifi.c::wifi_wait_for_event()
@@ -1300,16 +1306,20 @@ var WifiManager = (function() {
       },
 
       onEnabled: function(success) {
         callback(success);
       }
     });
   };
 
+  manager.getCapabilities = function() {
+    return capabilities;
+  }
+
   return manager;
 })();
 
 // Get unique key for a network, now the key is created by escape(SSID)+Security.
 // So networks of same SSID but different security mode can be identified.
 function getNetworkKey(network)
 {
   var ssid = "",
@@ -1746,17 +1756,17 @@ function WifiWorker() {
       // The select network command we used in associate() disables others networks.
       // Enable them here to make sure wpa_supplicant helps to connect to known
       // network automatically.
       self._enableAllNetworks();
       WifiManager.saveConfig(function() {})
     });
 
     try {
-      self._allowWpaEap = Services.prefs.getBoolPref("b2g.wifi.allow_unsafe_wpa_eap");
+      self._allowWpaEap = WifiManager.getCapabilities().eapSim;
     } catch (e) {
       self._allowWpaEap = false;
     }
 
     // Notify everybody, even if they didn't ask us to come up.
     WifiManager.getMacAddress(function (mac) {
       self.macAddress = mac;
       debug("Got mac: " + mac);