Added clamping to the battery capacity to work around buggy OS drivers

This commit is contained in:
Leon Styhre 2025-02-24 22:48:37 +01:00
parent 539e5ed57a
commit a6b573bc5c

View file

@ -452,6 +452,11 @@ void SystemStatus::getStatusBattery()
}
#endif
if (batteryCapacity < 0)
batteryCapacity = 0;
if (batteryCapacity > 100)
batteryCapacity = 100;
mHasBattery = hasBattery;
mBatteryCharging = batteryCharging;
mBatteryCapacity = batteryCapacity;