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

catch CwaSecurityException for update check (#244)

* catch CwaSecurityException for update

* catch CwaSecurityException for update
parent 86668d15
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ import com.google.android.play.core.install.model.AppUpdateType ...@@ -14,6 +14,7 @@ import com.google.android.play.core.install.model.AppUpdateType
import com.google.android.play.core.install.model.UpdateAvailability import com.google.android.play.core.install.model.UpdateAvailability
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.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
...@@ -31,12 +32,13 @@ class UpdateChecker(private val activity: LauncherActivity) { ...@@ -31,12 +32,13 @@ 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
// TODO replace with signature exception
val updateNeededFromServer: Boolean = try { val updateNeededFromServer: Boolean = try {
checkIfUpdatesNeededFromServer() checkIfUpdatesNeededFromServer()
} catch (exception: CwaSecurityException) {
Log.e(TAG, "CwaSecurityException caught:" + exception.localizedMessage)
true
} catch (exception: Exception) { } catch (exception: Exception) {
Log.e(TAG, exception.localizedMessage ?: "unknown error") Log.e(TAG, "Exception caught:" + exception.localizedMessage)
exception.printStackTrace()
false 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