From 9f85a662357150fae473a87948946831dbb72627 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 18 Sep 2020 16:27:08 -0300 Subject: [PATCH] Show a different text for stopped apps in app backups status page --- .../stevesoltys/seedvault/restore/RestoreProgressAdapter.kt | 1 + .../com/stevesoltys/seedvault/settings/SettingsViewModel.kt | 3 ++- .../main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt | 2 ++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressAdapter.kt b/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressAdapter.kt index 45e0cca8..588539ba 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressAdapter.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressAdapter.kt @@ -74,6 +74,7 @@ enum class AppRestoreStatus { NOT_YET_BACKED_UP, FAILED, FAILED_NO_DATA, + FAILED_WAS_STOPPED, FAILED_NOT_ALLOWED, FAILED_QUOTA_EXCEEDED, FAILED_NOT_INSTALLED, diff --git a/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt b/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt index 17628c7c..f8a8d74f 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt @@ -28,6 +28,7 @@ import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_NOT_ALLOWED import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_NO_DATA import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_QUOTA_EXCEEDED +import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_WAS_STOPPED import com.stevesoltys.seedvault.restore.AppRestoreStatus.NOT_YET_BACKED_UP import com.stevesoltys.seedvault.restore.AppRestoreStatus.SUCCEEDED import com.stevesoltys.seedvault.transport.backup.PackageService @@ -101,7 +102,7 @@ internal class SettingsViewModel( NOT_YET_BACKED_UP } NO_DATA -> FAILED_NO_DATA - WAS_STOPPED -> NOT_YET_BACKED_UP + WAS_STOPPED -> FAILED_WAS_STOPPED NOT_ALLOWED -> FAILED_NOT_ALLOWED QUOTA_EXCEEDED -> FAILED_QUOTA_EXCEEDED UNKNOWN_ERROR -> FAILED diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt index c8e40ae9..a07c8ab8 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt @@ -18,6 +18,7 @@ import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_NOT_ALLOWED import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_NOT_INSTALLED import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_NO_DATA import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_QUOTA_EXCEEDED +import com.stevesoltys.seedvault.restore.AppRestoreStatus.FAILED_WAS_STOPPED import com.stevesoltys.seedvault.restore.AppRestoreStatus.IN_PROGRESS import com.stevesoltys.seedvault.restore.AppRestoreStatus.NOT_YET_BACKED_UP import com.stevesoltys.seedvault.restore.AppRestoreStatus.SUCCEEDED @@ -66,6 +67,7 @@ internal open class AppViewHolder(protected val v: View) : RecyclerView.ViewHold private fun AppRestoreStatus.getInfo(): String = when (this) { NOT_YET_BACKED_UP -> context.getString(R.string.restore_app_not_yet_backed_up) FAILED_NO_DATA -> context.getString(R.string.restore_app_no_data) + FAILED_WAS_STOPPED -> context.getString(R.string.restore_app_was_stopped) FAILED_NOT_ALLOWED -> context.getString(R.string.restore_app_not_allowed) FAILED_NOT_INSTALLED -> context.getString(R.string.restore_app_not_installed) FAILED_QUOTA_EXCEEDED -> context.getString(R.string.restore_app_quota_exceeded) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6e616bf7..ba1a093e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -107,6 +107,7 @@ System package manager Not yet backed up + Not backed up as it wasn\'t used recently App reported no data for backup App doesn\'t allow backup App not installed