From 13324dd1a1f52dfeaa551d34d2a0c57d6be3940d Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 19 Apr 2021 15:33:08 -0400 Subject: [PATCH] Remove app update check on Android 5.x --- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 6 ++++++ .../java/eu/kanade/tachiyomi/ui/more/AboutController.kt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index dcb4146667..a1f6eee08e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi +import android.os.Build import androidx.core.content.edit import androidx.preference.PreferenceManager import eu.kanade.tachiyomi.data.backup.BackupCreatorJob @@ -142,6 +143,11 @@ object Migrations { if (oldVersion < 59) { // Reset rotation to Free after replacing Lock preferences.rotation().set(1) + + // Disable update check for Android 5.x users + if (BuildConfig.INCLUDE_UPDATER && Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { + UpdaterJob.cancelTask(context) + } } return true } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt index 5a762b6d33..50f4bd105d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt @@ -1,6 +1,7 @@ package eu.kanade.tachiyomi.ui.more import android.app.Dialog +import android.os.Build import android.os.Bundle import androidx.core.os.bundleOf import androidx.preference.PreferenceScreen @@ -142,6 +143,11 @@ class AboutController : SettingsController() { private fun checkVersion() { if (activity == null) return + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { + activity?.toast(R.string.update_check_eol) + return + } + activity?.toast(R.string.update_check_look_for_updates) launchNow {