From 3a15c6b8438d1a740af0d6ffdec72347eec8cb83 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 4 Nov 2023 20:26:47 -0400 Subject: [PATCH] Show EOL message if update check no-ops due to unsupported Android version --- .../presentation/more/settings/screen/about/AboutScreen.kt | 3 +++ .../java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt | 2 +- .../domain/release/interactor/GetApplicationRelease.kt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt index c12f3128e..6ae3bba16 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt @@ -228,6 +228,9 @@ object AboutScreen : Screen() { is GetApplicationRelease.Result.NoNewUpdate -> { context.toast(R.string.update_check_no_new_updates) } + is GetApplicationRelease.Result.OsTooOld -> { + context.toast(R.string.update_check_eol) + } else -> {} } } catch (e: Exception) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt index 3809fd6c5..5d4416315 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt @@ -15,7 +15,7 @@ class AppUpdateChecker { 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 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { - return GetApplicationRelease.Result.NoNewUpdate + return GetApplicationRelease.Result.OsTooOld } return withIOContext { diff --git a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt index 1a0ff4e4b..113e48af3 100644 --- a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt +++ b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt @@ -87,6 +87,7 @@ class GetApplicationRelease( sealed interface Result { data class NewUpdate(val release: Release) : Result data object NoNewUpdate : Result + data object OsTooOld : Result data object ThirdPartyInstallation : Result } }