mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
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:
parent
379f8d7e16
commit
918fe06248
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user