mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user