also looking at this
feat(android): setKeepAwake through the trampoline — ratchet 70 → 69
#174
7 files
+140
-13
| @@ -2577,6 +2577,11 @@ class CraftBridge( | ||
| 2577 | 2577 | |
| 2578 | 2578 | @JavascriptInterface |
| 2579 | 2579 | 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 | ||
| 2580 | 2585 | activity.runOnUiThread { |
| 2581 | 2586 | if (enabled) { |
| 2582 | 2587 | activity.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) |