Bug 891259: Set discharging time to 'Infinity', r=mounir

If the discharging time is unknown, the W3C Battery Status API
requires its value to be 'Infinity'. The current code returns a
discharging time of 0 when discharging the battery. This patch
fixes the problem.
This commit is contained in:
Thomas Zimmermann 2013-07-10 15:47:30 +02:00
Родитель 379f8d7e16
Коммит 918fe06248
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -435,7 +435,7 @@ GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
aBatteryInfo->charging() = true;
}
if (aBatteryInfo->charging() && (aBatteryInfo->level() < 1.0)) {
if (!aBatteryInfo->charging() || (aBatteryInfo->level() < 1.0)) {
aBatteryInfo->remainingTime() = dom::battery::kUnknownRemainingTime;
} else {
aBatteryInfo->remainingTime() = dom::battery::kDefaultRemainingTime;