Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #455 from cds-snc/issue/453/android-bridge-detect-…
Browse files Browse the repository at this point in the history
…timeout

Increase detect exposure timeout and disable lastCheckPeriod on Android
  • Loading branch information
henrytao-me authored Jul 6, 2020
2 parents abd50f4 + 63833fc commit a63aec0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private typealias Token = String
private const val START_RESOLUTION_FOR_RESULT_REQUEST_CODE = 9001
private const val GET_TEK_RESOLUTION_FOR_RESULT_REQUEST_CODE = 9002

private const val DETECT_EXPOSURE_TIMEOUT = 20000L
private const val DETECT_EXPOSURE_TIMEOUT = 30000L

class ExposureNotificationModule(context: ReactApplicationContext) : ReactContextBaseJavaModule(context), CoroutineScope, ActivityResultHelper, ExposureNotificationBroadcastReceiver.Helper {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Platform} from 'react-native';
import ExposureNotification, {ExposureSummary, Status as SystemStatus} from 'bridge/ExposureNotification';
import PushNotification from 'bridge/PushNotification';
import {addDays, daysBetween, periodSinceEpoch} from 'shared/date-fns';
Expand Down Expand Up @@ -261,7 +262,12 @@ export class ExposureNotificationService {
if (done) break;
if (!value) continue;
const {keysFileUrl, period} = value;
lastCheckedPeriod = Math.max(lastCheckedPeriod || 0, period);

// Temporarily disable persisting lastCheckPeriod on Android
// Ref https://github.com/cds-snc/covid-shield-mobile/issues/453
if (Platform.OS !== 'android') {
lastCheckedPeriod = Math.max(lastCheckedPeriod || 0, period);
}

try {
const summary = await this.exposureNotification.detectExposure(exposureConfiguration, [keysFileUrl]);
Expand Down

0 comments on commit a63aec0

Please sign in to comment.