From d991851c794283a1b4565d3bf27fd483ab59445c Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 19 Jul 2021 20:12:43 -0400 Subject: [PATCH] Add link to Don't Kill My App! in advanced settings Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com> --- .../ui/setting/SettingsAdvancedController.kt | 13 +++++++++++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 14 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt index 7c261807f3..5635cd8a56 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt @@ -30,6 +30,7 @@ import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.util.CrashLogUtil import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.openInBrowser import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope @@ -74,6 +75,7 @@ class SettingsAdvancedController : SettingsController() { CrashLogUtil(context).dumpLogs() } } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { val pm = context.getSystemService(Context.POWER_SERVICE) as? PowerManager? if (pm != null) preference { @@ -95,6 +97,17 @@ class SettingsAdvancedController : SettingsController() { } } } + + preference { + key = "pref_dont_kill_my_app" + title = "Don't kill my app!" + summaryRes = R.string.about_dont_kill_my_app + + onClick { + openInBrowser("https://dontkillmyapp.com/") + } + } + preferenceCategory { titleRes = R.string.data_management preference { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c18f34433b..a8de62fe5b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -719,6 +719,7 @@ Crash logs Dump crash logs Saves error logs to a file for sharing with the developers + Some manufacturers have additional app restrictions that kill background services. This website has more info on how to fix it. Crash logs saved Network DNS over HTTPS