From 697b082591987756dfe197b4ac23c14e8d6cd9e7 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 18 Jul 2021 13:04:32 -0400 Subject: [PATCH] Warn on backup creation for MIUI users --- .../kanade/tachiyomi/ui/setting/SettingsBackupController.kt | 5 +++++ app/src/main/res/values/strings.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt index 94fe870c8..fd94114b6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt @@ -63,6 +63,11 @@ class SettingsBackupController : SettingsController() { summaryRes = R.string.pref_create_backup_summ onClick { + if (MiuiUtil.isMiui() && MiuiUtil.isMiuiOptimizationDisabled()) { + context.toast(R.string.restore_miui_warning, Toast.LENGTH_LONG) + return@onClick + } + if (!BackupCreateService.isRunning(context)) { val ctrl = CreateBackupDialog() ctrl.targetController = this@SettingsBackupController diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a6429a94f..6d031ba25 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -422,7 +422,7 @@ What do you want to backup? Creating backup Backup failed - MIUI Optimization must be enabled for restore to work correctly. + MIUI Optimization must be enabled for backup/restore to work correctly. Restore is already in progress Restoring backup Restoring backup failed