Skip to content
Merged
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 @@ -132,6 +132,7 @@ class VoipNotification(private val context: Context) {
fun handleTimeout(context: Context, payload: VoipPayload) {
cancelTimeout(payload.callId)
disconnectTimedOutCall(payload.callId)
VoipCallService.stopService(context)
cancelById(context, payload.notificationId)
LocalBroadcastManager.getInstance(context).sendBroadcast(
Intent(ACTION_TIMEOUT).apply {
Expand Down Expand Up @@ -239,6 +240,13 @@ class VoipNotification(private val context: Context) {
Log.d(TAG, "Accept action triggered for callId: ${payload.callId}")
cancelTimeout(payload.callId)

// Install the DDP end-call listener here so the notification-accept path
// also tears down on hangup; previously only showIncomingCall installed it.
startListeningForCallEnd(context, payload)

// Start foreground service to keep call alive in background.
VoipCallService.startService(context, payload.callId)

val appCtx = context.applicationContext
// Guard so finish() is called at most once, whether by the REST callback or the timeout.
val finished = AtomicBoolean(false)
Expand Down Expand Up @@ -481,6 +489,7 @@ class VoipNotification(private val context: Context) {
}
cancelTimeout(callId)
disconnectIncomingCall(callId, false)
VoipCallService.stopService(appContext)
cancelById(appContext, payload.notificationId)
LocalBroadcastManager.getInstance(appContext).sendBroadcast(
Intent(ACTION_DISMISS).apply {
Expand Down
Loading