Misc fixes for update checking

This commit is contained in:
Mygod
2021-10-29 23:29:10 -04:00
parent 1b329558dc
commit f65875a381
4 changed files with 20 additions and 8 deletions

View File

@@ -68,6 +68,8 @@ class MainActivity : AppCompatActivity(), NavigationBarView.OnItemSelectedListen
try {
UpdateChecker.check().collect(this@MainActivity::onAppUpdateAvailable)
} catch (_: CancellationException) {
} catch (e: AppUpdate.IgnoredException) {
Timber.d(e)
} catch (e: Exception) {
Timber.w(e)
SmartSnackbar.make(e).show()

View File

@@ -3,6 +3,8 @@ package be.mygod.vpnhotspot.util
import android.app.Activity
interface AppUpdate {
class IgnoredException(cause: Throwable?) : RuntimeException(cause)
val downloaded: Boolean? get() = null
val message: String? get() = null
val stalenessDays: Int? get() = null