mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 710178 - ASSERTION: Battery API: When charging and level at 1.0, remaining time should be 0. Please fix your backend. r=mounir
This commit is contained in:
parent
a95afb1ac9
commit
2b92464205
@ -223,9 +223,15 @@ GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
|
||||
: ((double)status.BatteryLifePercent) / 100.0;
|
||||
aBatteryInfo->charging() = (status.ACLineStatus != 0);
|
||||
if (status.ACLineStatus != 0) {
|
||||
aBatteryInfo->remainingTime() =
|
||||
status.BatteryFullLifeTime == (DWORD)-1 ? kUnknownRemainingTime
|
||||
: status.BatteryFullLifeTime;
|
||||
if (aBatteryInfo->level() == 1.0) {
|
||||
// GetSystemPowerStatus API may returns -1 for BatteryFullLifeTime.
|
||||
// So, if battery is 100%, set kDefaultRemainingTime at force.
|
||||
aBatteryInfo->remainingTime() = kDefaultRemainingTime;
|
||||
} else {
|
||||
aBatteryInfo->remainingTime() =
|
||||
status.BatteryFullLifeTime == (DWORD)-1 ? kUnknownRemainingTime
|
||||
: status.BatteryFullLifeTime;
|
||||
}
|
||||
} else {
|
||||
aBatteryInfo->remainingTime() =
|
||||
status.BatteryLifeTime == (DWORD)-1 ? kUnknownRemainingTime
|
||||
|
Loading…
Reference in New Issue
Block a user