Loading app/src/main/java/foundation/e/drive/periodicScan/FullScanWorker.kt +25 −6 Original line number Diff line number Diff line Loading @@ -97,19 +97,38 @@ class FullScanWorker(private val context: Context, private val workerParams: Wor private fun checkStartConditions(account: Account?, prefs : SharedPreferences, requestCollector: SyncRequestCollector): Boolean { Timber.d("FullScanWorker.checkStartConditions()") if (account == null) return false if (account == null) { Timber.w("Account is null") return false } if (!isSetupDone(prefs)) return false if (!isSetupDone(prefs)) { Timber.w("Setup is not done") return false } if (isFileSyncDisabled(account)) return false //@todo could be replaced by checking list of sync folders not empty after loading them // TODO: could be replaced by checking list of sync folders not empty after loading them if (isFileSyncDisabled(account)) { Timber.w("File synchronization is disabled") return false } val forcedSync = workerParams.inputData.getBoolean(ACTION_FORCED_SYNC_KEY, false) if (!forcedSync && !isMinimumDelayRespected(prefs)) return false if (!forcedSync && !isMinimumDelayRespected(prefs)) { Timber.w("Minimum delay not respected") return false } if (!isConnectedToAllowedNetwork(account)) return false if (!isConnectedToAllowedNetwork(account)) { Timber.w("Not connected to allowed network") return false } if (!requestCollector.onPeriodicScanStart(applicationContext as Application)) return false if (!requestCollector.onPeriodicScanStart(applicationContext as Application)) { Timber.w("Periodic scan start is not allowed") return false } return true } Loading Loading
app/src/main/java/foundation/e/drive/periodicScan/FullScanWorker.kt +25 −6 Original line number Diff line number Diff line Loading @@ -97,19 +97,38 @@ class FullScanWorker(private val context: Context, private val workerParams: Wor private fun checkStartConditions(account: Account?, prefs : SharedPreferences, requestCollector: SyncRequestCollector): Boolean { Timber.d("FullScanWorker.checkStartConditions()") if (account == null) return false if (account == null) { Timber.w("Account is null") return false } if (!isSetupDone(prefs)) return false if (!isSetupDone(prefs)) { Timber.w("Setup is not done") return false } if (isFileSyncDisabled(account)) return false //@todo could be replaced by checking list of sync folders not empty after loading them // TODO: could be replaced by checking list of sync folders not empty after loading them if (isFileSyncDisabled(account)) { Timber.w("File synchronization is disabled") return false } val forcedSync = workerParams.inputData.getBoolean(ACTION_FORCED_SYNC_KEY, false) if (!forcedSync && !isMinimumDelayRespected(prefs)) return false if (!forcedSync && !isMinimumDelayRespected(prefs)) { Timber.w("Minimum delay not respected") return false } if (!isConnectedToAllowedNetwork(account)) return false if (!isConnectedToAllowedNetwork(account)) { Timber.w("Not connected to allowed network") return false } if (!requestCollector.onPeriodicScanStart(applicationContext as Application)) return false if (!requestCollector.onPeriodicScanStart(applicationContext as Application)) { Timber.w("Periodic scan start is not allowed") return false } return true } Loading