Skip to content

Commit

Permalink
fix: finish CallActivity and remove task when call is terminated (WPB…
Browse files Browse the repository at this point in the history
…-6437) 🍒 (#2968)

Co-authored-by: Oussama Hassine <[email protected]>
  • Loading branch information
github-actions[bot] and ohassine authored May 6, 2024
1 parent b5e662e commit 92415e0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ class NotificationChannelsManager @Inject constructor(
.setImportance(NotificationManagerCompat.IMPORTANCE_DEFAULT)
.setSound(outgoingCallSoundUri, audioAttributes)
.setShowBadge(false)
.setVibrationPattern(VIBRATE_PATTERN)
.setGroup(groupId)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fun IncomingCallScreen(
LaunchedEffect(incomingCallViewModel.incomingCallState.flowState) {
when (incomingCallViewModel.incomingCallState.flowState) {
is IncomingCallState.FlowState.CallClosed -> {
activity.finish()
activity.finishAndRemoveTask()
}

is IncomingCallState.FlowState.CallAccepted -> {
Expand All @@ -132,7 +132,7 @@ fun IncomingCallScreen(
(activity as CallActivity).openAppLockActivity()
},
onCallRejected = {
activity.finish()
activity.finishAndRemoveTask()
}
)
},
Expand All @@ -150,7 +150,7 @@ fun IncomingCallScreen(
}
},
onMinimiseScreen = {
activity.finish()
activity.moveTaskToBack(true)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fun OngoingCallScreen(
LaunchedEffect(ongoingCallViewModel.state.flowState) {
when (ongoingCallViewModel.state.flowState) {
OngoingCallState.FlowState.CallClosed -> {
activity.finish()
activity.finishAndRemoveTask()
}

OngoingCallState.FlowState.Default -> { /* do nothing */
Expand All @@ -134,7 +134,7 @@ fun OngoingCallScreen(
shouldShowDoubleTapToast = ongoingCallViewModel.shouldShowDoubleTapToast,
toggleSpeaker = sharedCallingViewModel::toggleSpeaker,
toggleMute = sharedCallingViewModel::toggleMute,
hangUpCall = { sharedCallingViewModel.hangUpCall { activity.finish() } },
hangUpCall = { sharedCallingViewModel.hangUpCall { activity.finishAndRemoveTask() } },
toggleVideo = sharedCallingViewModel::toggleVideo,
flipCamera = sharedCallingViewModel::flipCamera,
setVideoPreview = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fun OutgoingCallScreen(
LaunchedEffect(outgoingCallViewModel.state.flowState) {
when (outgoingCallViewModel.state.flowState) {
OutgoingCallState.FlowState.CallClosed -> {
activity.finish()
activity.finishAndRemoveTask()
}

OutgoingCallState.FlowState.CallEstablished -> {
Expand Down Expand Up @@ -105,7 +105,7 @@ fun OutgoingCallScreen(
}
},
onMinimiseScreen = {
activity.finish()
activity.moveTaskToBack(true)
}
)
}
Expand Down

0 comments on commit 92415e0

Please sign in to comment.