From 218313428faac7e360e96a7756cccf80e1d1046a Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 29 Feb 2020 16:30:40 -0500 Subject: [PATCH] Add warning on update check for Android 4.x users --- .../java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt | 6 ++++++ .../kanade/tachiyomi/ui/setting/SettingsAboutController.kt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt index 594ecd31b..386f9429a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.data.updater import android.app.PendingIntent import android.content.Intent +import android.os.Build import android.support.v4.app.NotificationCompat import com.evernote.android.job.Job import com.evernote.android.job.JobManager @@ -13,6 +14,11 @@ import eu.kanade.tachiyomi.util.notificationManager class UpdaterJob : Job() { override fun onRunJob(params: Params): Result { + // Android 4.x is no longer supported + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + return Result.SUCCESS + } + return UpdateChecker.getUpdateChecker() .checkForUpdate() .map { result -> diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt index 5e7fcc3e3..a766945c7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.setting import android.app.Dialog import android.content.Intent import android.net.Uri +import android.os.Build import android.os.Bundle import android.support.v7.preference.PreferenceScreen import android.view.View @@ -121,6 +122,11 @@ class SettingsAboutController : SettingsController() { private fun checkVersion() { if (activity == null) return + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + activity?.toast("Newer versions of Tachiyomi require Android 5+") + return + } + activity?.toast(R.string.update_check_look_for_updates) releaseSubscription?.unsubscribe() releaseSubscription = updateChecker.checkForUpdate()