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

(cherry picked from commit 3a15c6b8438d1a740af0d6ffdec72347eec8cb83)
This commit is contained in:
arkon 2023-11-04 20:26:47 -04:00 committed by Jobobby04
parent 0232a65a26
commit bd165456ae
3 changed files with 5 additions and 1 deletions

View File

@ -243,6 +243,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

@ -17,7 +17,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

@ -85,6 +85,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
} }
} }