mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
kindle: track suspend time (#9307)
This is useful for the sysstat plugin not to have 00:00 for suspend time :) Something similar should probably be done for the other canSuspend platforms.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local Generic = require("device/generic/device")
|
||||
local time = require("ui/time")
|
||||
local logger = require("logger")
|
||||
|
||||
local function yes() return true end
|
||||
@@ -147,6 +148,8 @@ local Kindle = Generic:new{
|
||||
isNightModeChallenged = no,
|
||||
-- NOTE: While this ought to behave on Zelda/Rex, turns out, nope, it really doesn't work on *any* of 'em :/ (c.f., ko#5884).
|
||||
canHWDither = no,
|
||||
-- The time the device went into suspend
|
||||
suspend_time = 0,
|
||||
}
|
||||
|
||||
function Kindle:initNetworkManager(NetworkMgr)
|
||||
@@ -277,10 +280,13 @@ end
|
||||
|
||||
function Kindle:wakeupFromSuspend()
|
||||
self.powerd:wakeupFromSuspend()
|
||||
self.last_suspend_time = time.boottime_or_realtime_coarse() - self.suspend_time
|
||||
self.total_suspend_time = self.total_suspend_time + self.last_suspend_time
|
||||
end
|
||||
|
||||
function Kindle:readyToSuspend()
|
||||
self.powerd:readyToSuspend()
|
||||
self.suspend_time = time.boottime_or_realtime_coarse()
|
||||
end
|
||||
|
||||
function Kindle:ambientBrightnessLevel()
|
||||
|
||||
Reference in New Issue
Block a user