Skip to content
Snippets Groups Projects
Commit 8ff951dd authored by Matthias Urhahn's avatar Matthias Urhahn
Browse files

Merge branch 'release/1.5.x' into fix/1.5.x-into-1.6.x

parents 80592fcb 1948fd85
No related branches found
No related tags found
No related merge requests found
...@@ -10,8 +10,9 @@ data class DownloadInfo( ...@@ -10,8 +10,9 @@ data class DownloadInfo(
val serverMD5 by lazy { headers.getPayloadChecksumMD5() } val serverMD5 by lazy { headers.getPayloadChecksumMD5() }
private fun Headers.getPayloadChecksumMD5(): String? { private fun Headers.getPayloadChecksumMD5(): String? {
// TODO EXPOSUREBACK-178
val fileMD5 = values("ETag").singleOrNull() val fileMD5 = values("ETag").singleOrNull()
// TODO EXPOSUREBACK-178
// var fileMD5 = headers.values("x-amz-meta-cwa-hash-md5").singleOrNull() // var fileMD5 = headers.values("x-amz-meta-cwa-hash-md5").singleOrNull()
// if (fileMD5 == null) { // if (fileMD5 == null) {
// headers.values("x-amz-meta-cwa-hash").singleOrNull() // headers.values("x-amz-meta-cwa-hash").singleOrNull()
......
...@@ -199,11 +199,7 @@ object RetrieveDiagnosisKeysTransaction : Transaction() { ...@@ -199,11 +199,7 @@ object RetrieveDiagnosisKeysTransaction : Transaction() {
.asyncRetrieveApplicationConfiguration() .asyncRetrieveApplicationConfiguration()
.supportedCountriesList .supportedCountriesList
} }
invokeSubmissionStartedInDebugOrBuildMode()
if (CWADebug.isDebugBuildOrMode) {
onKeyFilesDownloadStarted?.invoke()
onKeyFilesDownloadStarted = null
}
val availableKeyFiles = executeFetchKeyFilesFromServer(countries) val availableKeyFiles = executeFetchKeyFilesFromServer(countries)
...@@ -218,11 +214,7 @@ object RetrieveDiagnosisKeysTransaction : Transaction() { ...@@ -218,11 +214,7 @@ object RetrieveDiagnosisKeysTransaction : Transaction() {
onKeyFilesDownloadFinished?.invoke(availableKeyFiles.size, totalFileSize) onKeyFilesDownloadFinished?.invoke(availableKeyFiles.size, totalFileSize)
onKeyFilesDownloadFinished = null onKeyFilesDownloadFinished = null
} invokeSubmissionStartedInDebugOrBuildMode()
if (CWADebug.isDebugBuildOrMode) {
onApiSubmissionStarted?.invoke()
onApiSubmissionStarted = null
} }
val isSubmissionSuccessful = executeAPISubmission( val isSubmissionSuccessful = executeAPISubmission(
...@@ -231,16 +223,27 @@ object RetrieveDiagnosisKeysTransaction : Transaction() { ...@@ -231,16 +223,27 @@ object RetrieveDiagnosisKeysTransaction : Transaction() {
token = token token = token
) )
if (CWADebug.isDebugBuildOrMode) { invokeSubmissionFinishedInDebugOrBuildMode()
onApiSubmissionFinished?.invoke()
onApiSubmissionFinished = null
}
if (isSubmissionSuccessful) executeFetchDateUpdate(currentDate) if (isSubmissionSuccessful) executeFetchDateUpdate(currentDate)
executeClose() executeClose()
} }
private fun invokeSubmissionStartedInDebugOrBuildMode() {
if (CWADebug.isDebugBuildOrMode) {
onApiSubmissionStarted?.invoke()
onApiSubmissionStarted = null
}
}
private fun invokeSubmissionFinishedInDebugOrBuildMode() {
if (CWADebug.isDebugBuildOrMode) {
onApiSubmissionFinished?.invoke()
onApiSubmissionFinished = null
}
}
override suspend fun rollback() { override suspend fun rollback() {
super.rollback() super.rollback()
try { try {
......
...@@ -156,17 +156,15 @@ class SubmissionQRCodeScanFragment : Fragment(R.layout.fragment_submission_qr_co ...@@ -156,17 +156,15 @@ class SubmissionQRCodeScanFragment : Fragment(R.layout.fragment_submission_qr_co
permissions: Array<String>, permissions: Array<String>,
grantResults: IntArray grantResults: IntArray
) { ) {
if (requestCode == REQUEST_CAMERA_PERMISSION_CODE) { // if permission was denied
if (requestCode == REQUEST_CAMERA_PERMISSION_CODE &&
// permission was denied (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_DENIED)) {
if ((grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_DENIED)) {
if (shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) { if (shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) {
showCameraPermissionRationaleDialog() showCameraPermissionRationaleDialog()
} else { } else {
// user permanently denied access to the camera // user permanently denied access to the camera
showCameraPermissionDeniedDialog() showCameraPermissionDeniedDialog()
} }
}
} }
} }
......
...@@ -22,8 +22,10 @@ class GoogleAPIVersion @Inject constructor() { ...@@ -22,8 +22,10 @@ class GoogleAPIVersion @Inject constructor() {
val currentVersion = InternalExposureNotificationClient.getVersion() val currentVersion = InternalExposureNotificationClient.getVersion()
currentVersion >= compareVersion currentVersion >= compareVersion
} catch (apiException: ApiException) { } catch (apiException: ApiException) {
if (apiException.statusCode == CommonStatusCodes.API_NOT_CONNECTED) false if (apiException.statusCode != CommonStatusCodes.API_NOT_CONNECTED) {
else throw apiException throw apiException
}
return false
} }
} }
......
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