mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-11 10:47:39 +03:00
GuardService: only start if allowed
Change-Id: I8dfbe0885bfa816574841d5e2326d1daade02221
This commit is contained in:
parent
491fabe850
commit
f2976bc7ed
1 changed files with 2 additions and 1 deletions
|
@ -19,6 +19,7 @@ package im.vector.app.core.services
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.core.content.ContextCompat
|
||||
import im.vector.app.core.pushers.UPHelper
|
||||
import im.vector.app.features.settings.VectorPreferences
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
@ -28,7 +29,7 @@ class GuardServiceStarter @Inject constructor(
|
|||
private val appContext: Context
|
||||
) {
|
||||
fun start() {
|
||||
if (preferences.isBackgroundSyncEnabled()) {
|
||||
if (preferences.isBackgroundSyncEnabled() && UPHelper.allowBackgroundSync(appContext)) {
|
||||
try {
|
||||
Timber.i("## Sync: starting GuardService")
|
||||
val intent = Intent(appContext, GuardService::class.java)
|
||||
|
|
Loading…
Reference in a new issue