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.
This commit is contained in:
NiLuJe
2015-10-16 02:49:39 +02:00
parent 5979f9f855
commit bfb2ee703a
2 changed files with 4 additions and 1 deletions

View File

@@ -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()

View File

@@ -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