docs(signaling): add remoteMessaging FGS type rationale#1098
Merged
Conversation
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.
There was a problem hiding this comment.
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.xmlbefore theSignalingForegroundServicedeclaration. - Added an inline Kotlin comment at the
startForeground()call site describing theREMOTE_MESSAGINGrationale 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. |
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.
Summary
Adds inline documentation explaining why
foregroundServiceType="remoteMessaging"is used forSignalingForegroundService.AndroidManifest.xmlbefore the<service>declarationSignalingForegroundService.ktat thestartForeground()call siteNo logic changes — comments only.
Context
SignalingForegroundServicemaintains a persistent WebSocket connection to the WebTritsignaling server to exchange call-signaling messages (SDP, ICE candidates, call state events).
Android defines
remoteMessagingas the type for services that keep a long-running connectionalive 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 receivetype=0.Test plan
MissingForegroundServiceTypeExceptionorSecurityExceptionon Android 14+foregroundServiceType: 512(REMOTE_MESSAGING) visible in logcat on Android 14+type=0path taken on Android 13 and below