Unbinding callback from Call screen when view is destroyed

This commit is contained in:
Maxime NATUREL 2022-08-11 15:22:20 +02:00
parent fa8f72c909
commit 8667de423a
2 changed files with 5 additions and 0 deletions

View File

@ -241,6 +241,7 @@ class VectorCallActivity :
detachRenderersIfNeeded()
turnScreenOffAndKeyguardOn()
removeOnPictureInPictureModeChangedListener(pictureInPictureModeChangedInfoConsumer)
screenCaptureServiceConnection.unbind()
super.onDestroy()
}

View File

@ -47,6 +47,10 @@ class ScreenCaptureServiceConnection @Inject constructor(
}
}
fun unbind() {
callback = null
}
fun stopScreenCapturing() {
screenCaptureAndroidService?.stopService()
}