mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Make UIManager track prevent/allowStandby state. (#6558)
Conversely, Trapper and plugins report standby interruptibility.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local logger = require("logger")
|
||||
local UIManager = require("ui/uimanager")
|
||||
|
||||
local CommandRunner = {
|
||||
pio = nil,
|
||||
@@ -41,6 +42,7 @@ function CommandRunner:start(job)
|
||||
"sh plugins/backgroundrunner.koplugin/luawrapper.sh " ..
|
||||
"\"" .. self.job.executable .. "\""
|
||||
logger.dbg("CommandRunner: Will execute command " .. command)
|
||||
UIManager:preventStandby()
|
||||
self.pio = io.popen(command)
|
||||
end
|
||||
|
||||
@@ -71,6 +73,7 @@ function CommandRunner:poll()
|
||||
self.job.result = 222
|
||||
end
|
||||
end
|
||||
UIManager:allowStandby()
|
||||
self.pio:close()
|
||||
self.pio = nil
|
||||
self.job.end_sec = os.time()
|
||||
|
||||
Reference in New Issue
Block a user