Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application>
<!--
SignalingForegroundService uses foregroundServiceType="remoteMessaging".

This service maintains a persistent WebSocket connection to the WebTrit signaling
server to exchange call-signaling messages (SDP, ICE candidates, call state events).
The remoteMessaging type is defined by Android as the appropriate 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.

Required permission: FOREGROUND_SERVICE_REMOTE_MESSAGING (declared above).
Applies on Android 14+ (API 34+); older versions pass type=0.
-->
<service
android:name=".SignalingForegroundService"
android:foregroundServiceType="remoteMessaging"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ class SignalingForegroundService : Service() {
.setPriority(NotificationCompat.PRIORITY_LOW)
.build()

// FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING: this service maintains a persistent
// WebSocket to the WebTrit signaling server so it can receive call-signaling
// messages (SDP, ICE candidates, call events) at any time. The remoteMessaging
// type is the Android-defined category for exactly this use case.
// Passed to startForeground() on API 34+ only; older versions pass 0 and do
// not enforce a foreground service type here.
ServiceCompat.startForeground(
this,
NOTIFICATION_ID,
Expand Down
Loading