mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[plugin] AutoDim: reschedule on every tap (#9243)
This is a maintenance PR. With scheduling the next autodim_check on every tap, we can keep the device longer in standby mode. So we have more power savings. The long story: The current version works like that: Let's say I set the idle-time to 3 min and I need 2.5 min to read a page. Start at 0 min (next scheduled check is at/in 3 min) Read and tap to turn page after 2.5 min (next scheduled check is at 3 min - in 0.5 min) At 3 min there is a scheduled_check (wakeup) -> reschedule check in 3 min. Read and tap to turn page after 2.5 min (no wakeup) Then after 1 min there is a wakeup -> reschedule. ---> So I get an additional wakeup on every second page. This PR solves the problem: During normal reading I don't get any wakeup during reading. (The only drawback is, that one function is unscheduled/scheduled on every tap, but that is no big deal).
This commit is contained in:
@@ -173,6 +173,9 @@ end
|
||||
|
||||
function AutoDim:onInputEvent()
|
||||
self.last_action_time = UIManager:getElapsedTimeSinceBoot()
|
||||
-- Make sure the next scheduled autodim check is as much in the future
|
||||
-- as possible, to reduce wakes from standby.
|
||||
self:_schedule_autodim_task()
|
||||
end
|
||||
|
||||
function AutoDim:_unschedule_autodim_task()
|
||||
|
||||
Reference in New Issue
Block a user