From 8d85d047b7328f082da8d69fd09539ce7b893490 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 22 Nov 2023 09:42:39 +0100 Subject: [PATCH] Ensure Background sync is not stopped when there is an active call, even when the app goes to background. --- .../src/main/java/im/vector/app/VectorApplication.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vector-app/src/main/java/im/vector/app/VectorApplication.kt b/vector-app/src/main/java/im/vector/app/VectorApplication.kt index deb3d8d3aa..7b41c12773 100644 --- a/vector-app/src/main/java/im/vector/app/VectorApplication.kt +++ b/vector-app/src/main/java/im/vector/app/VectorApplication.kt @@ -189,11 +189,15 @@ class VectorApplication : fcmHelper.onEnterBackground(activeSessionHolder) if (stopBackgroundSync) { - Timber.i("App entered background: stop any background sync") - activeSessionHolder.getSafeActiveSessionAsync { - it?.syncService()?.stopAnyBackgroundSync() + if (webRtcCallManager.currentCall.get() == null) { + Timber.i("App entered background: stop any background sync") + activeSessionHolder.getSafeActiveSessionAsync { + it?.syncService()?.stopAnyBackgroundSync() + } + stopBackgroundSync = false + } else { + Timber.i("App entered background: there is an active call do not stop background sync") } - stopBackgroundSync = false } } })