Skip to content

feat(android): camera layer keeps working in the floating window - #1098

Merged
CaYatur merged 2 commits into
dev/androidfrom
android/camera-floating
Nov 17, 2026
Merged

CaYatur merged 2 commits into
dev/androidfrom
android/camera-floating

Conversation

@CaYatur

@CaYatur CaYatur commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Known limit from #1085: the camera layer only worked while the app was in front.

Cause (measured on the emulator): with only the floating window on screen the app is a background app. A camera opened before keeps streaming, but a camera reopened there (retry, scene recall, settings change) gives no frames: currentTime stayed 0.

Fix: media/CameraService.kt, a foreground service of type camera (+ FOREGROUND_SERVICE_CAMERA). It starts in floatingOpen while the app is still in front (Android allows camera FGS only then), only if the scene has an enabled camera layer (SVAndroid.floating.open sends camera: true) and the camera permission is granted. It stops on floatingClose and when the app comes back. Low-importance notification: "The visualizer is using the camera" (TR/EN).

Checked with node android/tools/probe.js floatcam (exit 0): service up while floating, camera reopened in the floating window streams (480 px, time advances), service gone after closing. Control run with camera: false: the reopened camera stays at currentTime 0.

Also updates the PLAN status lines.

For #1054

CaYatur and others added 2 commits November 17, 2026 17:49
With only the floating window on screen the app is in the background, and Android hands the camera to a background app only with a camera foreground service: a camera reopened there gave no frames (measured, currentTime stayed 0). CameraService (type camera) now starts with the floating window while the app is still in front, only when the scene has an enabled camera layer and the permission is granted, and stops when the window closes or the app comes back. Notification says the camera is in use. Probe floatcam.

For #1054

Co-authored-by: caganturgut <[email protected]>
…-floating

# Conflicts:
#	docs/android/PLAN.tr.md
@CaYatur
CaYatur merged commit 73e2fbb into dev/android Nov 17, 2026
7 checks passed
@CaYatur
CaYatur deleted the android/camera-floating branch November 17, 2026 17:42
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.

1 participant