Commit 90e4f08
committed
fix(call): fix native crashes, muted icons and state broadcast in calls
This commit contains the code from #6039 (thank you tareko!)
as it needed to be combined with more fixes during it's review.
PeerConnectionWrapper — native crash fixes:
- Call peerConnection.close() before dataChannel.dispose() so the WebRTC
signaling thread stops dispatching callbacks before native objects are freed
- Call peerConnection.close() outside the synchronized lock; holding the lock
deadlocks because close() blocks waiting for the signaling thread, which
itself needs the lock to run its callbacks
- Null out peerConnection before calling close() so in-flight callbacks see
null and return early instead of NPE-ing on peerConnection.hashCode() in
onIceConnectionChange, onCreateFailure, and onSetFailure
- Call dataChannel.unregisterObserver() before dispose() in both
removePeerConnection() and onDataChannel() to prevent the native observer
from calling back into a disposed Java DataChannel object
LocalStateBroadcasterNoMcu — initial mute state not sent to peers:
- IceConnectionStateObserver.job was never started, so local audio/video/
speaking state was never sent to newly connected participants; only a
manual mute+unmute triggered a broadcast
- handleCallParticipantAdded now accepts the live StateFlow<ParticipantUiState>
and uses first { it.isConnected } to send initial state exactly once when
ICE connects; base class gets a concrete StateFlow overload that defaults
to the existing snapshot path so MCU behaviour is unchanged
- Fix ParticipantHandler initial isConnected = false (was true), which caused
retrying when ICE actually connected
ParticipantHandler — guest audio not detected (cherry-pick of PR #6039):
- handleStreamChange() now sets isAudioEnabled from audio track presence,
not only isStreamEnabled from video tracks; guests whose DataChannel never
opens were permanently shown as muted despite having an active audio track
- handleIceConnectionStateChange() preserves audio/video state during ICE
NEW/CHECKING if tracks are still present, rather than resetting to false
unconditionally and relying on a DataChannel message to restore it
- Add GuestAudioDetectionTest and diagnostic logging
AI-assistant: Claude Code v2.1.142 (Claude Sonnet 4.6)
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>1 parent f0c9a14 commit 90e4f08
6 files changed
Lines changed: 215 additions & 29 deletions
File tree
- app/src
- main/java/com/nextcloud/talk
- activities
- call
- webrtc
- test/java/com/nextcloud/talk/activities
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2283 | 2283 | | |
2284 | 2284 | | |
2285 | 2285 | | |
2286 | | - | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
2287 | 2302 | | |
2288 | 2303 | | |
2289 | 2304 | | |
| |||
2301 | 2316 | | |
2302 | 2317 | | |
2303 | 2318 | | |
2304 | | - | |
2305 | 2319 | | |
2306 | 2320 | | |
2307 | 2321 | | |
2308 | 2322 | | |
2309 | 2323 | | |
2310 | | - | |
2311 | | - | |
2312 | | - | |
2313 | | - | |
2314 | | - | |
2315 | | - | |
2316 | | - | |
2317 | | - | |
| 2324 | + | |
| 2325 | + | |
2318 | 2326 | | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
2319 | 2335 | | |
2320 | 2336 | | |
2321 | 2337 | | |
| |||
Lines changed: 35 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
82 | 94 | | |
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
86 | | - | |
| 98 | + | |
| 99 | + | |
87 | 100 | | |
88 | 101 | | |
89 | 102 | | |
| |||
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
103 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
104 | 121 | | |
105 | 122 | | |
106 | 123 | | |
107 | 124 | | |
108 | | - | |
109 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
110 | 135 | | |
111 | 136 | | |
112 | 137 | | |
113 | 138 | | |
114 | 139 | | |
115 | 140 | | |
116 | 141 | | |
| 142 | + | |
117 | 143 | | |
118 | 144 | | |
119 | 145 | | |
120 | 146 | | |
| 147 | + | |
121 | 148 | | |
122 | 149 | | |
123 | 150 | | |
124 | 151 | | |
| 152 | + | |
125 | 153 | | |
126 | 154 | | |
127 | 155 | | |
128 | 156 | | |
| 157 | + | |
129 | 158 | | |
130 | 159 | | |
131 | 160 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
Lines changed: 27 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
241 | 241 | | |
242 | | - | |
243 | 242 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
251 | 263 | | |
252 | 264 | | |
253 | 265 | | |
| |||
497 | 509 | | |
498 | 510 | | |
499 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
500 | 515 | | |
501 | 516 | | |
502 | 517 | | |
| |||
577 | 592 | | |
578 | 593 | | |
579 | 594 | | |
| 595 | + | |
580 | 596 | | |
581 | 597 | | |
582 | 598 | | |
| |||
607 | 623 | | |
608 | 624 | | |
609 | 625 | | |
610 | | - | |
| 626 | + | |
611 | 627 | | |
612 | 628 | | |
613 | 629 | | |
614 | 630 | | |
615 | 631 | | |
616 | | - | |
| 632 | + | |
617 | 633 | | |
618 | 634 | | |
619 | 635 | | |
| |||
Lines changed: 123 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments