mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-11-27 22:46:48 +01:00
Fix overflow that prevents matching
This commit is contained in:
parent
5b06366cd5
commit
4e3c03cfaa
@ -346,7 +346,7 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit
|
|||||||
val keys = listSingleDiagnosisKeysPendingSearch(tid, database)
|
val keys = listSingleDiagnosisKeysPendingSearch(tid, database)
|
||||||
val oldestRpi = oldestRpi
|
val oldestRpi = oldestRpi
|
||||||
for (key in keys) {
|
for (key in keys) {
|
||||||
if ((key.rollingStartIntervalNumber + key.rollingPeriod) * ROLLING_WINDOW_LENGTH_MS + ALLOWED_KEY_OFFSET_MS < oldestRpi) {
|
if ((key.rollingStartIntervalNumber + key.rollingPeriod).toLong() * ROLLING_WINDOW_LENGTH_MS + ALLOWED_KEY_OFFSET_MS < oldestRpi) {
|
||||||
// Early ignore because key is older than since we started scanning.
|
// Early ignore because key is older than since we started scanning.
|
||||||
applySingleDiagnosisKeySearchResult(key, false, database)
|
applySingleDiagnosisKeySearchResult(key, false, database)
|
||||||
} else {
|
} else {
|
||||||
@ -385,7 +385,7 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit
|
|||||||
riskLogged = key.transmissionRiskLevel
|
riskLogged = key.transmissionRiskLevel
|
||||||
Log.d(TAG, "First key with risk ${key.transmissionRiskLevel}: ${ByteString.of(*key.keyData).hex()} starts ${key.rollingStartIntervalNumber}")
|
Log.d(TAG, "First key with risk ${key.transmissionRiskLevel}: ${ByteString.of(*key.keyData).hex()} starts ${key.rollingStartIntervalNumber}")
|
||||||
}
|
}
|
||||||
if ((key.rollingStartIntervalNumber + key.rollingPeriod) * ROLLING_WINDOW_LENGTH_MS + ALLOWED_KEY_OFFSET_MS < oldestRpi) {
|
if ((key.rollingStartIntervalNumber + key.rollingPeriod).toLong() * ROLLING_WINDOW_LENGTH_MS + ALLOWED_KEY_OFFSET_MS < oldestRpi) {
|
||||||
// Early ignore because key is older than since we started scanning.
|
// Early ignore because key is older than since we started scanning.
|
||||||
ignored++;
|
ignored++;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user