From cbcb1d96984e00516c5edac529f4c85146c10658 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sat, 15 Nov 2025 22:54:52 +0100 Subject: [PATCH] android: allow calling `Device:hasColorScreen()` in a fork (#14628) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cache the result of `android.isColorScreen()` once and for all (since the result is static). This fix a regression from #14505, where `Device:hasColorScreen()` is called from a fork when the file browser tries to generate covers, resulting in a crash: ``` … F reader.launche: thread.cc:1326] Check failed: FindStackTop() > reinterpret_cast(tlsPtr_.stack_end) … ``` --- frontend/device/android/device.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index 4db31c6b4..42142f256 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -80,7 +80,7 @@ local Device = Generic:extend{ hasSeamlessWifiToggle = no, -- Requires losing focus to the sytem's network settings and user interaction hasExitOptions = no, hasEinkScreen = function() return android.isEink() end, - hasColorScreen = android.isColorScreen, + hasColorScreen = android.isColorScreen() and yes or no, hasFrontlight = android.hasLights, hasNaturalLight = android.isWarmthDevice, canRestart = no,