android: allow calling Device:hasColorScreen() in a fork (#14628)

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<void*>(tlsPtr_.stack_end) …
```
This commit is contained in:
Benoit Pierre authored and GitHub committed 2025-11-15 22:54:52 +01:00
1 parent 55c9d60428
commit cbcb1d9698
1 file changed
+1 -1
+1 -1
View File
@@ -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,