Bug 950124 - Use different powersave command based on sdk version. r=vchang, a=1.3+
authorChuck Lee <chulee@mozilla.com>
Fri, 10 Jan 2014 12:12:38 +0800
changeset 175716 210e31f22de1cc548dbd62c71c78cda4b934c72f
parent 175715 2e8a7007ceec1ae3ab5c5de3f41b324890e2d300
child 175717 2353b531ccc61fd6764cdb36b770d97afc0e9296
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvchang, 1
bugs950124
milestone28.0a2
Bug 950124 - Use different powersave command based on sdk version. r=vchang, a=1.3+
dom/wifi/WifiCommand.jsm
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiCommand.jsm
+++ b/dom/wifi/WifiCommand.jsm
@@ -305,21 +305,26 @@ this.WifiCommand = function(aControlMess
   command.addToBlacklist = function (bssid, callback) {
     doBooleanCommand("BLACKLIST " + bssid, "OK", callback);
   };
 
   command.clearBlacklist = function (callback) {
     doBooleanCommand("BLACKLIST clear", "OK", callback);
   };
 
-  command.setSuspendOptimizations = function (enabled, callback) {
+  command.setSuspendOptimizationsICS = function (enabled, callback) {
     doBooleanCommand("DRIVER SETSUSPENDOPT " + (enabled ? 0 : 1),
                      "OK", callback);
   };
 
+  command.setSuspendOptimizationsJB = function (enabled, callback) {
+    doBooleanCommand("DRIVER SETSUSPENDMODE " + (enabled ? 1 : 0),
+                     "OK", callback);
+  };
+
   command.connectToSupplicant = function(callback) {
     voidControlMessage("connect_to_supplicant", callback);
   };
 
   command.closeSupplicantConnection = function(callback) {
     voidControlMessage("close_supplicant_connection", callback);
   };
 
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -1154,17 +1154,19 @@ var WifiManager = (function() {
   manager.wpsPin = wifiCommand.wpsPin;
   manager.wpsCancel = wifiCommand.wpsCancel;
   manager.setPowerMode = (sdkVersion >= 16)
                          ? wifiCommand.setPowerModeJB
                          : wifiCommand.setPowerModeICS;
   manager.getHttpProxyNetwork = getHttpProxyNetwork;
   manager.setHttpProxy = setHttpProxy;
   manager.configureHttpProxy = configureHttpProxy;
-  manager.setSuspendOptimizations = wifiCommand.setSuspendOptimizations;
+  manager.setSuspendOptimizations = (sdkVersion >= 16)
+                                   ? wifiCommand.setSuspendOptimizationsJB
+                                   : wifiCommand.setSuspendOptimizationsICS;
   manager.setStaticIpMode = setStaticIpMode;
   manager.getRssiApprox = wifiCommand.getRssiApprox;
   manager.getLinkSpeed = wifiCommand.getLinkSpeed;
   manager.getDhcpInfo = function() { return dhcpInfo; }
   manager.getConnectionInfo = (sdkVersion >= 15)
                               ? wifiCommand.getConnectionInfoICS
                               : wifiCommand.getConnectionInfoGB;