|
9 | 9 |
|
10 | 10 | <application> |
11 | 11 | <!-- |
12 | | - foregroundServiceType="remoteMessaging" is the correct type for SignalingForegroundService. |
| 12 | + SignalingForegroundService uses foregroundServiceType="remoteMessaging". |
13 | 13 |
|
14 | | - This service maintains a persistent WebSocket connection to the WebTrit signaling server |
15 | | - to send and receive call-signaling messages (SDP offers/answers, ICE candidates, call |
16 | | - state events). It never accesses the microphone, camera, or location — it is purely a |
17 | | - messaging transport layer that runs before, during, and after a call. |
18 | | -
|
19 | | - Why NOT phoneCall: |
20 | | - The phoneCall type is reserved for services that actively manage a call via the Android |
21 | | - Telecom API (audio focus, in-call UI, connection state). That responsibility belongs to |
22 | | - webtrit_callkeep running in the callkeep_core process via PhoneConnectionService. |
23 | | - SignalingForegroundService sits below that layer: it delivers the signaling payloads |
24 | | - that allow the Telecom layer to set up and tear down calls, but it does not manage |
25 | | - calls itself. Using phoneCall here would require MANAGE_OWN_CALLS or default-dialer |
26 | | - privileges and would be semantically incorrect. |
27 | | -
|
28 | | - Why NOT microphone / camera: |
29 | | - This service does not capture any media. WebRTC media is handled by a separate |
30 | | - component (flutter-webrtc) that runs in the main app process. |
31 | | -
|
32 | | - Why NOT dataSync: |
33 | | - dataSync is for periodic background sync tasks. This service holds a continuous |
34 | | - real-time connection — not a periodic one. |
35 | | -
|
36 | | - Android documentation for remoteMessaging: |
37 | | - "Use this type if the app needs to be kept running on-device so that a remote |
38 | | - service can send messages to the device." |
39 | | - This matches exactly: the WebSocket is kept alive so the signaling server can push |
40 | | - call events to the device at any time, without relying solely on FCM. |
| 14 | + This service maintains a persistent WebSocket connection to the WebTrit signaling |
| 15 | + server to exchange call-signaling messages (SDP, ICE candidates, call state events). |
| 16 | + The remoteMessaging type is defined by Android as the appropriate type for services |
| 17 | + that keep a long-running connection alive so a remote server can deliver messages to |
| 18 | + the device at any time — which is exactly what this service does. |
41 | 19 |
|
42 | 20 | Required permission: FOREGROUND_SERVICE_REMOTE_MESSAGING (declared above). |
43 | | - Applies on Android 14+ (API 34, UPSIDE_DOWN_CAKE); older versions use type=0. |
| 21 | + Applies on Android 14+ (API 34+); older versions pass type=0. |
44 | 22 | --> |
45 | 23 | <service |
46 | 24 | android:name=".SignalingForegroundService" |
|
0 commit comments