Show EOL message if update check no-ops due to unsupported Android version

This commit is contained in:
arkon 2023-11-04 20:26:47 -04:00
parent db20d04c4b
commit 3a15c6b843
3 changed files with 5 additions and 1 deletions

View file

@ -228,6 +228,9 @@ object AboutScreen : Screen() {
is GetApplicationRelease.Result.NoNewUpdate -> { is GetApplicationRelease.Result.NoNewUpdate -> {
context.toast(R.string.update_check_no_new_updates) context.toast(R.string.update_check_no_new_updates)
} }
is GetApplicationRelease.Result.OsTooOld -> {
context.toast(R.string.update_check_eol)
}
else -> {} else -> {}
} }
} catch (e: Exception) { } catch (e: Exception) {

View file

@ -15,7 +15,7 @@ class AppUpdateChecker {
suspend fun checkForUpdate(context: Context, forceCheck: Boolean = false): GetApplicationRelease.Result { suspend fun checkForUpdate(context: Context, forceCheck: Boolean = false): GetApplicationRelease.Result {
// Disabling app update checks for older Android versions that we're going to drop support for // Disabling app update checks for older Android versions that we're going to drop support for
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
return GetApplicationRelease.Result.NoNewUpdate return GetApplicationRelease.Result.OsTooOld
} }
return withIOContext { return withIOContext {

View file

@ -87,6 +87,7 @@ class GetApplicationRelease(
sealed interface Result { sealed interface Result {
data class NewUpdate(val release: Release) : Result data class NewUpdate(val release: Release) : Result
data object NoNewUpdate : Result data object NoNewUpdate : Result
data object OsTooOld : Result
data object ThirdPartyInstallation : Result data object ThirdPartyInstallation : Result
} }
} }