Add setScreenAlwasyOn API to DisplayService#438
Merged
jperedadnr merged 3 commits intogluonhq:masterfrom Apr 9, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new DisplayService#setScreenAlwaysOn(boolean) API to control “keep screen on” behavior on supported platforms, addressing the requested functionality in #420.
Changes:
- Introduces
setScreenAlwaysOn(boolean)inDisplayService. - Implements the API on Android and iOS via new native/JNI bridges.
- Provides a desktop no-op implementation to satisfy the interface across platforms.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/display/src/main/java/com/gluonhq/attach/display/DisplayService.java | Adds the public API and Javadoc for controlling “screen always on”. |
| modules/display/src/main/java/com/gluonhq/attach/display/impl/AndroidDisplayService.java | Wires lifecycle handling + JNI entrypoint for Android implementation. |
| modules/display/src/main/native/android/c/display.c | Adds JNI bridge from AndroidDisplayService into the Dalvik helper for setting the keep-screen-on flag. |
| modules/display/src/main/native/android/dalvik/DalvikDisplayService.java | Implements Android-side window flag toggling on the UI thread. |
| modules/display/src/main/java/com/gluonhq/attach/display/impl/IOSDisplayService.java | Adds lifecycle-aware state tracking and native call for iOS implementation. |
| modules/display/src/main/native/ios/Display.m | Implements iOS native toggle via UIApplication.idleTimerDisabled on the main queue. |
| modules/display/src/main/java/com/gluonhq/attach/display/impl/DesktopDisplayService.java | Adds a no-op implementation for desktop. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
erwin1
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #420