Skip to content

docs(signaling): add remoteMessaging FGS type rationale#1098

Merged
SERDUN merged 3 commits into
developfrom
docs/signaling-fgs-remote-messaging-rationale
Apr 10, 2026
Merged

docs(signaling): add remoteMessaging FGS type rationale#1098
SERDUN merged 3 commits into
developfrom
docs/signaling-fgs-remote-messaging-rationale

Conversation

@SERDUN

@SERDUN SERDUN commented Apr 10, 2026

Copy link
Copy Markdown
Member

Summary

Adds inline documentation explaining why foregroundServiceType="remoteMessaging" is used for SignalingForegroundService.

  • XML comment in AndroidManifest.xml before the <service> declaration
  • Inline comment in SignalingForegroundService.kt at the startForeground() call site

No logic changes — comments only.


Context

SignalingForegroundService maintains a persistent WebSocket connection to the WebTrit
signaling server to exchange call-signaling messages (SDP, ICE candidates, call state events).

Android defines remoteMessaging as the type for services that keep a long-running connection
alive so a remote server can deliver messages to the device at any time — which is exactly
what this service does. The WebSocket stays open so the signaling server can push call events
to the device without relying solely on FCM.

Required permission: FOREGROUND_SERVICE_REMOTE_MESSAGING (already declared in the manifest).
The type is passed to startForeground() on API 34+ only; older versions receive type=0.


Test plan

  • No MissingForegroundServiceTypeException or SecurityException on Android 14+
  • foregroundServiceType: 512 (REMOTE_MESSAGING) visible in logcat on Android 14+
  • type=0 path taken on Android 13 and below

SERDUN added 2 commits April 10, 2026 18:10
SignalingForegroundService maintains a persistent WebSocket to the signaling
server and never accesses microphone, camera, or location. remoteMessaging
is the semantically accurate type for this use case.

Added inline comments in AndroidManifest.xml and SignalingForegroundService.kt
explaining why remoteMessaging is chosen over phoneCall, microphone, or dataSync,
to prevent future misunderstandings during reviews or platform upgrades.
@SERDUN SERDUN changed the title docs(signaling): document why remoteMessaging is the correct FGS type docs(signaling): add remoteMessaging FGS type rationale Apr 10, 2026
@SERDUN SERDUN requested a review from Copilot April 10, 2026 15:18
@SERDUN SERDUN marked this pull request as ready for review April 10, 2026 15:18

Copilot AI 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.

Pull request overview

This PR adds inline documentation clarifying why the Android foreground service is categorized as foregroundServiceType="remoteMessaging" for the signaling WebSocket, aligning the implementation with Android 14+ foreground service type requirements.

Changes:

  • Added an explanatory XML comment in AndroidManifest.xml before the SignalingForegroundService declaration.
  • Added an inline Kotlin comment at the startForeground() call site describing the REMOTE_MESSAGING rationale and API-level behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/webtrit_signaling_service/webtrit_signaling_service_android/android/src/main/kotlin/com/webtrit/signaling_service/SignalingForegroundService.kt Adds inline rationale for using FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING at the startForeground() call site.
packages/webtrit_signaling_service/webtrit_signaling_service_android/android/src/main/AndroidManifest.xml Adds manifest-level documentation explaining why foregroundServiceType="remoteMessaging" is appropriate and which permission/API levels apply.

@SERDUN SERDUN merged commit 9212632 into develop Apr 10, 2026
1 check passed
@SERDUN SERDUN deleted the docs/signaling-fgs-remote-messaging-rationale branch April 10, 2026 15:24
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