mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user