|
|
@ -206,7 +206,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function KindlePowerD:checkUnexpectedWakeup()
|
|
|
|
function KindlePowerD:checkUnexpectedWakeup()
|
|
|
|
local state = self:getPowerdState()
|
|
|
|
local state = self:getPowerdState()
|
|
|
|
logger.info("Powerd resume state:", state)
|
|
|
|
logger.dbg("Powerd resume state:", state)
|
|
|
|
-- If we moved on to the active state,
|
|
|
|
-- If we moved on to the active state,
|
|
|
|
-- then we were woken by user input not our alarm.
|
|
|
|
-- then we were woken by user input not our alarm.
|
|
|
|
if state ~= "screenSaver" and state ~= "suspended" then return end
|
|
|
|
if state ~= "screenSaver" and state ~= "suspended" then return end
|
|
|
@ -214,7 +214,7 @@ function KindlePowerD:checkUnexpectedWakeup()
|
|
|
|
if self.device.wakeup_mgr:isWakeupAlarmScheduled() and self.device.wakeup_mgr:wakeupAction() then
|
|
|
|
if self.device.wakeup_mgr:isWakeupAlarmScheduled() and self.device.wakeup_mgr:wakeupAction() then
|
|
|
|
logger.info("Kindle scheduled wakeup")
|
|
|
|
logger.info("Kindle scheduled wakeup")
|
|
|
|
else
|
|
|
|
else
|
|
|
|
logger.info("Kindle unscheduled wakeup")
|
|
|
|
logger.warn("Kindle unscheduled wakeup")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -228,7 +228,7 @@ function KindlePowerD:initWakeupMgr()
|
|
|
|
if self.lipc_handle == nil then return end
|
|
|
|
if self.lipc_handle == nil then return end
|
|
|
|
|
|
|
|
|
|
|
|
function KindlePowerD:wakeupFromSuspend()
|
|
|
|
function KindlePowerD:wakeupFromSuspend()
|
|
|
|
logger.info("Kindle wakeupFromSuspend")
|
|
|
|
logger.dbg("Kindle wakeupFromSuspend")
|
|
|
|
-- Give the device a few seconds to settle.
|
|
|
|
-- Give the device a few seconds to settle.
|
|
|
|
-- This filters out user input resumes -> device will resume to active
|
|
|
|
-- This filters out user input resumes -> device will resume to active
|
|
|
|
-- Also the Kindle stays in Ready to suspend for 10 seconds
|
|
|
|
-- Also the Kindle stays in Ready to suspend for 10 seconds
|
|
|
@ -238,7 +238,7 @@ function KindlePowerD:initWakeupMgr()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function KindlePowerD:readyToSuspend()
|
|
|
|
function KindlePowerD:readyToSuspend()
|
|
|
|
logger.info("Kindle readyToSuspend")
|
|
|
|
logger.dbg("Kindle readyToSuspend")
|
|
|
|
if self.device.wakeup_mgr:isWakeupAlarmScheduled() then
|
|
|
|
if self.device.wakeup_mgr:isWakeupAlarmScheduled() then
|
|
|
|
local now = os.time()
|
|
|
|
local now = os.time()
|
|
|
|
local alarm = self.device.wakeup_mgr:getWakeupAlarmEpoch()
|
|
|
|
local alarm = self.device.wakeup_mgr:getWakeupAlarmEpoch()
|
|
|
|