Stop GuardService when a distributor is registered

Change-Id: Ieec92659f6d3493684dc4312336f8329163c4589
This commit is contained in:
S1m 2021-11-22 00:34:01 +01:00 committed by SpiritCroc
parent f2976bc7ed
commit b381acd60d
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.BuildConfig
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.network.WifiDetector
import im.vector.app.core.services.GuardServiceStarter
import im.vector.app.features.badge.BadgeProxy
import im.vector.app.features.notifications.NotifiableEventResolver
import im.vector.app.features.notifications.NotificationDrawerManager
@ -205,6 +206,9 @@ val upHandler = object: VectorMessagingReceiverHandler {
if (context == null || !UPHelper.allowBackgroundSync(context)) {
val mode = BackgroundSyncMode.FDROID_BACKGROUND_SYNC_MODE_DISABLED
vectorPreferences.setFdroidSyncBackgroundMode(mode)
if (context != null) {
GuardServiceStarter(vectorPreferences, context).stop()
}
}
}