Skip to content

Add Android standby, remote wake and managed kiosk power - #10

Merged
mrinc merged 9 commits into
masterfrom
feat/android-sleep-wake
Sep 15, 2026
Merged

mrinc merged 9 commits into
masterfrom
feat/android-sleep-wake

Conversation

@bcbetterninja

@bcbetterninja bcbetterninja commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Android previously kept displaying content until the device itself slept, ignored BF sleep timeouts and rejected remote power commands. This adds black, dimmed standby that releases all camera/WebView playback while keeping the authenticated control connection alive. Touch, remote/mouse input, accessibility activation or BF Wake restores the latest layout without activating content with the waking gesture.

  • Honor the display sleep timeout independently of network I/O, preserve idle layout return, report standby/awake and validate power commands against the current assigned display even when no layouts remain.
  • Advertise android-standby-v1; server routes, command filtering and UI enable Standby/Wake only for capable APKs. Other management commands remain blocked.
  • Add optional device-owner provisioning, persistent Home launch and managed lock task. A separate local screen-off action uses Android's owner lock API. Ordinary installs receive no admin privileges or automatic screen pinning.
  • Preserve standby across activity-state restoration; release playback on true screen-off and resume after power wake/unlock. Content updates do not wake standby.

True hardware sleep suspends networking: BF remote wake applies to soft standby while the screen remains on. Hardware power/remote controls wake actual screen-off; secure lock screens still require unlocking. Device-specific scheduled wake, HDMI-CEC and remote power-on are not added. Managed mode keeps BF's local Settings accessible and does not introduce an administrator PIN.

WebSocket power commands bypass stalled HTTP work and recheck the source socket, session generation and display assignment at execution. Android power requests await fresh assignment validation, the WebSocket write result and an accepted device acknowledgement before recording success, and retain the original target when assignments change during dispatch. Empty-layout responses carry an authoritative display identity so remote Wake survives removal of the last layout without accepting revoked assignments.

CI also exposed a PostgreSQL shutdown race: the adapter now waits for socket closure after pool shutdown, with deterministic regressions and a real-database cleanup check.

Heartbeats carry atomic session/revision samples and share serialized server power updates with acknowledged commands. Delayed older samples cannot overwrite a newer confirmed transition, including across reconnects.

Local power changes still report when only HTTP is available. Bounded disconnected-session history retains revision ordering without requiring a live WebSocket.

Validation on final signed commit 573cf69: all CI checks pass. Android passes 53 emulator tests, managed Home/lock-task/screen-off/wake and cleanup tests, both ABI builds, unit tests, lint and signed-upgrade continuity. Server passes all104 tests including PostgreSQL integration; shared core/bridge tests, Linux, Windows, ioBOX and deployment checks pass. All seven review conversations are addressed and resolved.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b0edb8ac-0ebf-4312-8de4-9e00114b367f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 039014323b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/src/plugins/service-coordinator-ws/index.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68927ceebb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread client/android/app/src/main/java/cloud/betterportal/frame/ViewerSession.kt Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c361e7d6c7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/src/plugins/service-admin-http/routes-admin.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbe97ac26d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread client/android/app/src/main/java/cloud/betterportal/frame/ViewerSession.kt Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2672c188d7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread client/android/app/src/main/java/cloud/betterportal/frame/ViewerSession.kt Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a89d621d4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread client/android/app/src/main/java/cloud/betterportal/frame/ViewerSession.kt Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e3510a7c2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/src/plugins/service-api-http/index.ts Outdated
@mrinc
mrinc merged commit 1d007da into master Sep 15, 2026
10 checks passed
@mrinc
mrinc deleted the feat/android-sleep-wake branch September 15, 2026 06:43
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.

2 participants