Force poll the battery when showing the menu.

Making sure to always show up to date info.

Also fix the battery polling cache invalidation logic to actually
work?
Should make it behave properly on devices where we handle resuming
ourselves.
pull/1674/head
NiLuJe 9 years ago
parent 5979f9f855
commit bfb2ee703a

@ -74,7 +74,8 @@ function BasePowerD:getCapacity()
end
function BasePowerD:refreshCapacity()
self:getCapacityHW()
-- We want our next getCapacity call to actually pull up to date info instead of a cached value ;)
self.capacity_pulled_count = self.capacity_cached_count
end
function BasePowerD:isCharging()

@ -381,6 +381,8 @@ function TouchMenu:init()
}
self.bar:switchToTab(self.last_index or 1)
-- Make sure we always show an up to date battery status when first opening the menu...
Device:getPowerDevice():refreshCapacity()
self:updateItems()
end

Loading…
Cancel
Save