Add warning on update check for Android 4.x users

This commit is contained in:
arkon 2020-02-29 16:30:40 -05:00
parent 44b47b49bc
commit 218313428f
2 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.data.updater
import android.app.PendingIntent import android.app.PendingIntent
import android.content.Intent import android.content.Intent
import android.os.Build
import android.support.v4.app.NotificationCompat import android.support.v4.app.NotificationCompat
import com.evernote.android.job.Job import com.evernote.android.job.Job
import com.evernote.android.job.JobManager import com.evernote.android.job.JobManager
@ -13,6 +14,11 @@ import eu.kanade.tachiyomi.util.notificationManager
class UpdaterJob : Job() { class UpdaterJob : Job() {
override fun onRunJob(params: Params): Result { 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() return UpdateChecker.getUpdateChecker()
.checkForUpdate() .checkForUpdate()
.map { result -> .map { result ->

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.setting
import android.app.Dialog import android.app.Dialog
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.support.v7.preference.PreferenceScreen import android.support.v7.preference.PreferenceScreen
import android.view.View import android.view.View
@ -121,6 +122,11 @@ class SettingsAboutController : SettingsController() {
private fun checkVersion() { private fun checkVersion() {
if (activity == null) return 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) activity?.toast(R.string.update_check_look_for_updates)
releaseSubscription?.unsubscribe() releaseSubscription?.unsubscribe()
releaseSubscription = updateChecker.checkForUpdate() releaseSubscription = updateChecker.checkForUpdate()