ReviewOS

also looking at this

craft-native/craft

feat(android): setKeepAwake through the trampoline — ratchet 70 → 69

#174
Merged glennmichael123 wants to merge feat/android-keep-awake into main
7 files +140 -13
packages/android/templates/CraftBridge.kt.templatemodified+5-0
Changes to packages/android/templates/CraftBridge.kt.template
@@ -2577,6 +2577,11 @@ class CraftBridge(
25772577
25782578 @JavascriptInterface
25792579 fun setKeepAwake(enabled: Boolean): Boolean {
2580 // Zig queues the same window call on the same looper. isKeepingAwake
2581 // below is written here and read nowhere, so the Kotlin body not
2582 // running leaves nothing stale — unlike the flashlight pair.
2583 if (CraftNative.setKeepAwake(activity, enabled)) return true
2584
25802585 activity.runOnUiThread {
25812586 if (enabled) {
25822587 activity.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)