diff --git a/vector/src/main/java/im/vector/app/VectorApplication.kt b/vector/src/main/java/im/vector/app/VectorApplication.kt index 9b3db9d4cf..ce0c8166fb 100644 --- a/vector/src/main/java/im/vector/app/VectorApplication.kt +++ b/vector/src/main/java/im/vector/app/VectorApplication.kt @@ -44,7 +44,6 @@ import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.extensions.configureAndStart import im.vector.app.core.extensions.startSyncing import im.vector.app.core.rx.RxConfig -import im.vector.app.core.services.GuardServiceStarter import im.vector.app.features.call.webrtc.WebRtcCallManager import im.vector.app.features.configuration.VectorConfiguration import im.vector.app.features.disclaimer.doNotShowDisclaimerDialog @@ -166,7 +165,6 @@ class VectorApplication : if (authenticationService.hasAuthenticatedSessions() && !activeSessionHolder.hasActiveSession()) { val lastAuthenticatedSession = authenticationService.getLastAuthenticatedSession()!! activeSessionHolder.setActiveSession(lastAuthenticatedSession) - guardServiceStarter.start() lastAuthenticatedSession.configureAndStart(applicationContext, startSyncing = false) } diff --git a/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt b/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt index e739cac95f..6b7b5f7f62 100644 --- a/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt +++ b/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt @@ -18,6 +18,7 @@ package im.vector.app.core.di import arrow.core.Option import im.vector.app.ActiveSessionDataSource +import im.vector.app.core.services.GuardServiceStarter import im.vector.app.features.call.webrtc.WebRtcCallManager import im.vector.app.features.crypto.keysrequest.KeyRequestHandler import im.vector.app.features.crypto.verification.IncomingVerificationRequestHandler @@ -36,7 +37,8 @@ class ActiveSessionHolder @Inject constructor(private val sessionObservableStore private val callManager: WebRtcCallManager, private val pushRuleTriggerListener: PushRuleTriggerListener, private val sessionListener: SessionListener, - private val imageManager: ImageManager + private val imageManager: ImageManager, + private val guardServiceStarter: GuardServiceStarter ) { private var activeSession: AtomicReference = AtomicReference() @@ -52,6 +54,7 @@ class ActiveSessionHolder @Inject constructor(private val sessionObservableStore pushRuleTriggerListener.startWithSession(session) session.callSignalingService().addCallListener(callManager) imageManager.onSessionStarted(session) + guardServiceStarter.start() } fun clearActiveSession() {