Skip to content
Snippets Groups Projects
Unverified Commit 16fd9dab authored by Hee Tatt Ooi's avatar Hee Tatt Ooi Committed by GitHub
Browse files

bugfix for in app update (#361)

parent 7db5d8e9
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ import androidx.appcompat.app.AlertDialog ...@@ -6,7 +6,7 @@ import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat.startActivity import androidx.core.content.ContextCompat.startActivity
import de.rki.coronawarnapp.BuildConfig import de.rki.coronawarnapp.BuildConfig
import de.rki.coronawarnapp.R import de.rki.coronawarnapp.R
import de.rki.coronawarnapp.exception.CwaSecurityException import de.rki.coronawarnapp.exception.ApplicationConfigurationCorruptException
import de.rki.coronawarnapp.server.protocols.ApplicationConfigurationOuterClass import de.rki.coronawarnapp.server.protocols.ApplicationConfigurationOuterClass
import de.rki.coronawarnapp.service.applicationconfiguration.ApplicationConfigurationService import de.rki.coronawarnapp.service.applicationconfiguration.ApplicationConfigurationService
import de.rki.coronawarnapp.ui.LauncherActivity import de.rki.coronawarnapp.ui.LauncherActivity
...@@ -22,12 +22,14 @@ class UpdateChecker(private val activity: LauncherActivity) { ...@@ -22,12 +22,14 @@ class UpdateChecker(private val activity: LauncherActivity) {
} }
suspend fun checkForUpdate() { suspend fun checkForUpdate() {
// check if an update is needed based on server config // check if an update is needed based on server config
val updateNeededFromServer: Boolean = try { val updateNeededFromServer: Boolean = try {
checkIfUpdatesNeededFromServer() checkIfUpdatesNeededFromServer()
} catch (exception: CwaSecurityException) { } catch (exception: ApplicationConfigurationCorruptException) {
Timber.e("CwaSecurityException caught:%s", exception.localizedMessage) Timber.e(
"ApplicationConfigurationCorruptException caught:%s",
exception.localizedMessage
)
true true
} catch (exception: Exception) { } catch (exception: Exception) {
Timber.e("Exception caught:%s", exception.localizedMessage) Timber.e("Exception caught:%s", exception.localizedMessage)
...@@ -83,7 +85,7 @@ class UpdateChecker(private val activity: LauncherActivity) { ...@@ -83,7 +85,7 @@ class UpdateChecker(private val activity: LauncherActivity) {
minVersionFromServerString minVersionFromServerString
) )
Timber.e("needs update:$needsImmediateUpdate") Timber.e("needs update:$needsImmediateUpdate")
return true return needsImmediateUpdate
} }
private fun constructSemanticVersionString( private fun constructSemanticVersionString(
......
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