Make UIManager track prevent/allowStandby state. (#6558)

Conversely, Trapper and plugins report standby interruptibility.
This commit is contained in:
ezdiy
2020-08-30 15:01:56 +02:00
committed by GitHub
parent 4cff623244
commit fd31bcc5fd
5 changed files with 52 additions and 2 deletions

View File

@@ -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()