PowerStatus: use the design capacity if needed.

* When the last full capacity is not available, use the design
  capacity of the battery instead.
This commit is contained in:
Axel Dörfler 2015-01-28 10:51:07 +01:00
parent 85f43155fe
commit 2d9c195093

View File

@ -109,6 +109,8 @@ Battery::GetBatteryInfoCached(battery_info* info)
info->current_rate = fCachedInfo.current_rate;
info->capacity = fCachedInfo.capacity;
info->full_capacity = fExtendedBatteryInfo.last_full_charge;
if (info->full_capacity < 0)
info->full_capacity = fExtendedBatteryInfo.design_capacity;
fRateBuffer.AddRate(fCachedInfo.current_rate);
if (fCachedInfo.current_rate > 0 && fRateBuffer.GetMeanRate() != 0) {