[Android] Enable CoverBrowser (#3264)

I was reminded by @KenMaltby that this is disabled on Android.

https://www.mobileread.com/forums/showthread.php?p=3586162#post3586162
pull/3271/head
Frans de Jonge 7 years ago committed by GitHub
parent 94c0e01b7f
commit ff3ca5d98d

@ -1,4 +1,3 @@
local Device = require("device")
local InputContainer = require("ui/widget/container/inputcontainer")
local UIManager = require("ui/uimanager")
local logger = require("logger")
@ -38,12 +37,7 @@ local CoverBrowser = InputContainer:new{}
function CoverBrowser:init()
self.full_featured = true
-- As we don't know how to run and kill subprocesses on Android (for
-- background info extraction), this plugin is very limited on Android,
-- and will provide only a menu for managing a few core settings.
if Device.isAndroid() then
self.full_featured = false
end
-- Set to false to provide a fallback option with only a menu for managing a few core settings.
self.ui.menu:registerToMainMenu(self)

@ -1,5 +1,4 @@
local ffi = require("ffi")
local util = require("ffi/util")
local C = ffi.C
-- Utilities functions needed by this plugin, but that may be added to
@ -9,24 +8,19 @@ local xutil = {}
-- Sub-process management (may be put into base/ffi/util.lua)
function xutil.runInSubProcess(func)
if util.isAndroid() then
-- not sure how to do that on android
return nil
else
local pid = C.fork()
if pid == 0 then -- child process
-- Just run the provided lua code object in this new process,
-- and exit immediatly (so we do not release drivers and
-- resources still used by parent process)
func()
os.exit(0)
end
-- parent/main process, return pid of child
if pid == -1 then -- On failure, -1 is returned in the parent
return false
end
return pid
local pid = C.fork()
if pid == 0 then -- child process
-- Just run the provided lua code object in this new process,
-- and exit immediatly (so we do not release drivers and
-- resources still used by parent process)
func()
os.exit(0)
end
-- parent/main process, return pid of child
if pid == -1 then -- On failure, -1 is returned in the parent
return false
end
return pid
end
function xutil.isSubProcessDone(pid)

Loading…
Cancel
Save