Ensure Background sync is not stopped when there is an active call, even when the app goes to background.

This commit is contained in:
Benoit Marty 2023-11-22 09:42:39 +01:00
parent 84158ece37
commit 8d85d047b7
1 changed files with 8 additions and 4 deletions

View File

@ -189,11 +189,15 @@ class VectorApplication :
fcmHelper.onEnterBackground(activeSessionHolder) fcmHelper.onEnterBackground(activeSessionHolder)
if (stopBackgroundSync) { if (stopBackgroundSync) {
if (webRtcCallManager.currentCall.get() == null) {
Timber.i("App entered background: stop any background sync") Timber.i("App entered background: stop any background sync")
activeSessionHolder.getSafeActiveSessionAsync { activeSessionHolder.getSafeActiveSessionAsync {
it?.syncService()?.stopAnyBackgroundSync() it?.syncService()?.stopAnyBackgroundSync()
} }
stopBackgroundSync = false stopBackgroundSync = false
} else {
Timber.i("App entered background: there is an active call do not stop background sync")
}
} }
} }
}) })