Bug 950124 - Use different powersave command based on sdk version. r=vchang

This commit is contained in:
Chuck Lee 2014-01-10 12:12:38 +08:00
Родитель 335bcadaa9
Коммит 2b45cc4e49
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -310,11 +310,16 @@ this.WifiCommand = function(aControlMessage, aInterface) {
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);
};

Просмотреть файл

@ -1156,7 +1156,9 @@ var WifiManager = (function() {
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;