Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cwa App Android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Foertsch
Cwa App Android
Commits
1284fe91
Unverified
Commit
1284fe91
authored
4 years ago
by
Hee Tatt Ooi
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cleanup time constants class (#397)
* cleanup for time variables * removed unused function
parent
77452bf4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/TimeVariables.kt
+13
-28
13 additions, 28 deletions
.../src/main/java/de/rki/coronawarnapp/risk/TimeVariables.kt
with
13 additions
and
28 deletions
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/TimeVariables.kt
+
13
−
28
View file @
1284fe91
package
de.rki.coronawarnapp.risk
import
com.google.android.gms.common.api.ApiException
import
de.rki.coronawarnapp.BuildConfig
import
de.rki.coronawarnapp.CoronaWarnApplication
import
de.rki.coronawarnapp.exception.ExceptionCategory
import
de.rki.coronawarnapp.exception.reporting.report
...
...
@@ -89,26 +90,22 @@ object TimeVariables {
*/
fun
getMaxStaleExposureRiskRange
():
Int
=
MAX_STALE_EXPOSURE_RISK_RANGE
/**
* This is the exact number of days until the end of time is reached.
* This is used by the Google Exposure Notification API daysSinceLastExposure property in the
* ExposureSummary if there was no contact with someone.
*/
private
const
val
END_OF_TIME_DAYS
=
2147483647
/**
* Getter function for [END_OF_TIME_DAYS]
*
* @return number of days until end of time
*/
fun
getEndOfTimeDays
()
=
END_OF_TIME_DAYS
private
const
val
MILISECONDS_IN_A_SECOND
=
1000
private
const
val
SECONDS_IN_A_MINUTES
=
60
private
const
val
MINUTES_IN_AN_HOUR
=
60
private
const
val
HOURS_IN_AN_DAY
=
24
/**
* Delay in milliseconds for manual key retrieval process
*
Internal requirements: 24 hours
= 1000 * 60 *
60 * 24 milliseconds
*
TODO Change this to the real 24 Hour
s
*
Value for testing: 1 min
=
1000 * 60 *
1
*
Value: 24 hours = 1000 * 60 * 60 * 24 millisecond
s
*/
private
const
val
MANUAL_KEY_RETRIEVAL_DELAY
=
1000
*
60
*
1
private
val
MANUAL_KEY_RETRIEVAL_DELAY
=
if
(
BuildConfig
.
FLAVOR
==
"deviceForTesters"
)
{
MILISECONDS_IN_A_SECOND
*
SECONDS_IN_A_MINUTES
}
else
{
MILISECONDS_IN_A_SECOND
*
SECONDS_IN_A_MINUTES
*
MINUTES_IN_AN_HOUR
*
HOURS_IN_AN_DAY
}
/**
* Getter function for [MANUAL_KEY_RETRIEVAL_DELAY]
...
...
@@ -160,18 +157,6 @@ object TimeVariables {
* CALCULATED TIME VARIABLES
****************************************************/
/**
* The timeRange for calculating the exposure risk figures
* In milliseconds
*
* @return Pair of Long describing the timerange in milliseconds
*/
fun
getCalculationTimeRange
():
Pair
<
Long
,
Long
>
=
Pair
(
getTimeRangeFromRetentionPeriod
(),
System
.
currentTimeMillis
()
)
/**
* The time since the last successful exposure calculation ran in foreground or background.
* In milliseconds
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment