Bug 968689 - Netd BandwidthController sets costlyAlert to invalid quota. r=vchang

This commit is contained in:
Albert Crespell 2014-02-10 09:03:29 +01:00
parent 75ef6cdec5
commit 79f9376708

View File

@ -169,12 +169,19 @@ NetworkService.prototype = {
return;
}
if (threshold < 0) {
this._disableNetworkInterfaceAlarm(networkName, callback);
return;
}
let self = this;
this._disableNetworkInterfaceAlarm(networkName, function(result) {
if (threshold < 0) {
if (!isError(result.resultCode)) {
callback.networkUsageAlarmResult(null);
return;
}
callback.networkUsageAlarmResult(result.reason);
return
}
this._setNetworkInterfaceAlarm(networkName, threshold, callback);
self._setNetworkInterfaceAlarm(networkName, threshold, callback);
});
},
_setNetworkInterfaceAlarm: function(networkName, threshold, callback) {
@ -232,11 +239,7 @@ NetworkService.prototype = {
params.isAsync = true;
this.controlMessage(params, function(result) {
if (!isError(result.resultCode)) {
callback.networkUsageAlarmResult(null);
return;
}
callback.networkUsageAlarmResult(result.reason);
callback(result);
});
},