CanvasContext.hasEinkScreen(): avoid crash on Android (#9417)

It is used by CoverBrowser, in a subprocess, when extracting
metadata from PicDocuments, and crash on Android as calling
android methods is only allowed from the main thread.
reviewable/pr9442/r1
poire-z 2 years ago committed by GitHub
parent d98fa04d13
commit 55c0fc6190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,7 +52,11 @@ function CanvasContext:init(device)
Mupdf.bgr = true
end
self.hasEinkScreen = device.hasEinkScreen
-- This one may be called by a subprocess, and would crash on Android when
-- calling android.isEink() which is only allowed from the main thread.
local hasEinkScreen = device.hasEinkScreen()
self.hasEinkScreen = function() return hasEinkScreen end
self.canHWDither = device.canHWDither
self.fb_bpp = device.screen.fb_bpp
end

Loading…
Cancel
Save