diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7433527e789..524bc3b8e5a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -95,6 +95,7 @@ android:launchMode="singleTop" android:hardwareAccelerated="true" android:screenOrientation="portrait" + android:taskAffinity="wire.call" android:theme="@style/AppTheme" /> Unit, - pauseSendingVideoFeed: () -> Unit + pauseSendingVideoFeed: () -> Unit, + onClearVideoPreview: () -> Unit ) { val lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current DisposableEffect(lifecycleOwner, isCameraOn, callStatus) { @@ -198,6 +200,9 @@ private fun handleVideoPreviewOnLifecycleChange( if (event == Lifecycle.Event.ON_RESUME && callStatus == CallStatus.ESTABLISHED && isCameraOn) { startSendingVideoFeed() } + if (event == Lifecycle.Event.ON_DESTROY) { + onClearVideoPreview() + } } lifecycleOwner.lifecycle.addObserver(observer) @@ -230,7 +235,7 @@ private fun OngoingCallContent( flipCamera: () -> Unit, setVideoPreview: (view: View) -> Unit, clearVideoPreview: () -> Unit, - navigateBack: () -> Unit, + onCollapse: () -> Unit, hideDoubleTapToast: () -> Unit, onPermissionPermanentlyDenied: (type: PermissionDenialType) -> Unit, requestVideoStreams: (participants: List) -> Unit @@ -258,7 +263,7 @@ private fun OngoingCallContent( else -> "" }, isCbrEnabled = isCbrEnabled, - onCollapse = navigateBack, + onCollapse = onCollapse, protocolInfo = protocolInfo, mlsVerificationStatus = mlsVerificationStatus, proteusVerificationStatus = proteusVerificationStatus diff --git a/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt index e1fa9e5325d..dfd44100f6c 100644 --- a/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt @@ -25,8 +25,6 @@ import com.wire.android.config.TestDispatcherProvider import com.wire.android.mapper.UICallParticipantMapper import com.wire.android.mapper.UserTypeMapper import com.wire.android.media.CallRinger -import com.wire.android.util.CurrentScreen -import com.wire.android.util.CurrentScreenManager import com.wire.android.util.ui.WireSessionImageLoader import com.wire.kalium.logic.data.call.VideoState import com.wire.kalium.logic.data.id.ConversationId @@ -48,7 +46,6 @@ import io.mockk.coVerify import io.mockk.every import io.mockk.impl.annotations.MockK import io.mockk.verify -import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest @@ -109,9 +106,6 @@ class SharedCallingViewModelTest { @MockK private lateinit var userTypeMapper: UserTypeMapper - @MockK - private lateinit var currentScreenManager: CurrentScreenManager - @MockK(relaxed = true) private lateinit var onCompleted: () -> Unit @@ -130,9 +124,6 @@ class SharedCallingViewModelTest { coEvery { allCalls.invoke() } returns emptyFlow() coEvery { observeConversationDetails.invoke(any()) } returns emptyFlow() coEvery { observeSpeaker.invoke() } returns emptyFlow() - coEvery { currentScreenManager.observeCurrentScreen(any()) } returns MutableStateFlow( - CurrentScreen.SomeOther - ) sharedCallingViewModel = SharedCallingViewModel( conversationId = conversationId, @@ -152,7 +143,6 @@ class SharedCallingViewModelTest { uiCallParticipantMapper = uiCallParticipantMapper, wireSessionImageLoader = wireSessionImageLoader, userTypeMapper = userTypeMapper, - currentScreenManager = currentScreenManager, dispatchers = TestDispatcherProvider() ) }