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 f2bce17c2..7e64471ba 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
@@ -67,36 +67,40 @@ class SettingsAdvancedController : SettingsController() {
}
}
- preference {
- key = "pref_disable_battery_optimization"
- titleRes = R.string.pref_disable_battery_optimization
- summaryRes = R.string.pref_disable_battery_optimization_summary
+ preferenceCategory {
+ titleRes = R.string.label_background_activity
- onClick {
- val packageName: String = context.packageName
- if (!context.powerManager.isIgnoringBatteryOptimizations(packageName)) {
- try {
- val intent = Intent().apply {
- action = Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
- data = "package:$packageName".toUri()
+ preference {
+ key = "pref_disable_battery_optimization"
+ titleRes = R.string.pref_disable_battery_optimization
+ summaryRes = R.string.pref_disable_battery_optimization_summary
+
+ onClick {
+ val packageName: String = context.packageName
+ if (!context.powerManager.isIgnoringBatteryOptimizations(packageName)) {
+ try {
+ val intent = Intent().apply {
+ action = Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
+ data = "package:$packageName".toUri()
+ }
+ startActivity(intent)
+ } catch (e: ActivityNotFoundException) {
+ context.toast(R.string.battery_optimization_setting_activity_not_found)
}
- startActivity(intent)
- } catch (e: ActivityNotFoundException) {
- context.toast(R.string.battery_optimization_setting_activity_not_found)
+ } else {
+ context.toast(R.string.battery_optimization_disabled)
}
- } else {
- context.toast(R.string.battery_optimization_disabled)
}
}
- }
- preference {
- key = "pref_dont_kill_my_app"
- title = "Don't kill my app!"
- summaryRes = R.string.about_dont_kill_my_app
+ 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/")
+ onClick {
+ openInBrowser("https://dontkillmyapp.com/")
+ }
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 79b48d62e..9c284216a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -448,11 +448,12 @@
Dump crash logs
Saves error logs to a file for sharing with the developers
Crash logs saved
+ Background activity
Disable battery optimization
Helps with background library updates and backups
- Some manufacturers have additional app restrictions that kill background services. This website has more info on how to fix it.
Battery optimization is already disabled
Couldn\'t open device settings
+ Some manufacturers have additional app restrictions that kill background services. This website has more info on how to fix it.
Website