Skip to content

Add setScreenAlwasyOn API to DisplayService#438

Merged
jperedadnr merged 3 commits intogluonhq:masterfrom
jperedadnr:420-alwayson
Apr 9, 2026
Merged

Add setScreenAlwasyOn API to DisplayService#438
jperedadnr merged 3 commits intogluonhq:masterfrom
jperedadnr:420-alwayson

Conversation

@jperedadnr
Copy link
Copy Markdown
Contributor

Fixes #420

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) in DisplayService.
  • 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.

@jperedadnr jperedadnr merged commit 8db6e6c into gluonhq:master Apr 9, 2026
1 check passed
@jperedadnr jperedadnr deleted the 420-alwayson branch April 9, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Function proposal: screen always on

3 participants