Show EOL message if update check no-ops due to unsupported Android version
(cherry picked from commit 3a15c6b8438d1a740af0d6ffdec72347eec8cb83)
This commit is contained in:
parent
0232a65a26
commit
bd165456ae
@ -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) {
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user