Skip to content
Snippets Groups Projects
Unverified Commit 72827a08 authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Remove minimum tracing time requirement (EXPOSUREAPP-3051) (#1762)


* Remove minimum tracing time requirement.

* LINT issues.

Co-authored-by: default avatarBMItter <46747780+BMItter@users.noreply.github.com>
Co-authored-by: default avatarharambasicluka <64483219+harambasicluka@users.noreply.github.com>
parent 79a51578
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,6 @@ import de.rki.coronawarnapp.task.TaskFactory
import de.rki.coronawarnapp.task.common.DefaultProgress
import de.rki.coronawarnapp.util.BackgroundModeStatus
import de.rki.coronawarnapp.util.ConnectivityHelper.isNetworkEnabled
import de.rki.coronawarnapp.util.TimeAndDateExtensions.millisecondsToHours
import de.rki.coronawarnapp.util.TimeStamper
import de.rki.coronawarnapp.util.di.AppContext
import kotlinx.coroutines.channels.ConflatedBroadcastChannel
......@@ -125,30 +124,15 @@ class RiskLevelTask @Inject constructor(
Timber.d("areKeyPkgsOutDated(): Age is %dh for latest key package: %s", it.standardHours, latestDownload)
}
return (downloadAge.isLongerThan(STALE_DOWNLOAD_LIMIT) && isActiveTracingTimeAboveThreshold()).also {
return (downloadAge.isLongerThan(STALE_DOWNLOAD_LIMIT)).also {
if (it) {
Timber.tag(TAG).i("areKeyPkgsOutDated(): Calculation was not possible because reults are outdated.")
Timber.tag(TAG).i("areKeyPkgsOutDated(): Calculation was not possible because results are outdated.")
} else {
Timber.tag(TAG).d("areKeyPkgsOutDated(): Key pkgs are fresh :), continuing evaluation.")
}
}
}
private fun isActiveTracingTimeAboveThreshold(): Boolean {
Timber.tag(TAG).d("Evaluating isActiveTracingTimeAboveThreshold()")
val durationTracingIsActive = TimeVariables.getTimeActiveTracingDuration()
val activeTracingDurationInHours = durationTracingIsActive.millisecondsToHours()
val durationTracingIsActiveThreshold = TimeVariables.getMinActivatedTracingTime().toLong()
return (activeTracingDurationInHours >= durationTracingIsActiveThreshold).also {
Timber.tag(TAG).v(
"Active tracing time ($activeTracingDurationInHours h) is above threshold " +
"($durationTracingIsActiveThreshold h): $it"
)
}
}
private suspend fun calculateRiskLevel(configData: ExposureWindowRiskCalculationConfig): RiskLevelTaskResult {
Timber.tag(TAG).d("Calculating risklevel")
val exposureWindows = enfClient.exposureWindows()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment