Use PluginShare to exchange data between plugins (#2981)

pull/2985/head
Hzj_jie 7 years ago committed by GitHub
parent 4ec96e377a
commit e67ff2ab98

@ -0,0 +1,3 @@
-- PluginShare is a table for plugins to exchange data between each other. Plugins should maintain
-- their own protocols.
return {}

@ -4,6 +4,7 @@ if not Device:isKobo() and not Device:isSDL() then return { disabled = true, } e
local DataStorage = require("datastorage")
local LuaSettings = require("luasettings")
local PluginShare = require("pluginshare")
local UIManager = require("ui/uimanager")
local WidgetContainer = require("ui/widget/container/widgetcontainer")
local logger = require("logger")
@ -53,7 +54,14 @@ function AutoSuspend:_schedule(settings_id)
return
end
local delay = self.last_action_sec + self.auto_suspend_sec - os.time()
local delay
if PluginShare.pause_auto_suspend then
delay = self.auto_suspend_sec
else
delay = self.last_action_sec + self.auto_suspend_sec - os.time()
end
if delay <= 0 then
logger.dbg("AutoSuspend: will suspend the device")
UIManager:suspend()

@ -28,8 +28,9 @@ local function showConfirmBox()
end
if Device:isKobo() then
disable = function() UIManager:_startAutoSuspend() end
enable = function() UIManager:_stopAutoSuspend() end
local PluginShare = require("pluginshare")
enable = function() PluginShare.pause_auto_suspend = true end
disable = function() PluginShare.pause_auto_suspend = false end
elseif Device:isKindle() then
disable = function()
os.execute("lipc-set-prop com.lab126.powerd preventScreenSaver 0")

Loading…
Cancel
Save