diff --git a/app/src/main/java/com/stevesoltys/seedvault/settings/AppListRetriever.kt b/app/src/main/java/com/stevesoltys/seedvault/settings/AppListRetriever.kt index 5f8f0025..2e5885d8 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/settings/AppListRetriever.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/settings/AppListRetriever.kt @@ -14,6 +14,7 @@ import com.stevesoltys.seedvault.transport.backup.PackageService import com.stevesoltys.seedvault.ui.AppBackupState import com.stevesoltys.seedvault.ui.AppBackupState.FAILED import com.stevesoltys.seedvault.ui.AppBackupState.FAILED_NOT_ALLOWED +import com.stevesoltys.seedvault.ui.AppBackupState.FAILED_NOT_INSTALLED import com.stevesoltys.seedvault.ui.AppBackupState.FAILED_NO_DATA import com.stevesoltys.seedvault.ui.AppBackupState.FAILED_QUOTA_EXCEEDED import com.stevesoltys.seedvault.ui.AppBackupState.FAILED_WAS_STOPPED @@ -68,13 +69,18 @@ internal class AppListRetriever( ) return specialPackages.map { (packageName, stringId) -> val metadata = metadataManager.getPackageMetadata(packageName) + val status = if (packageName == PACKAGE_NAME_CONTACTS && metadata?.state == null) { + // handle local contacts backup specially as it might not be installed + if (packageService.getVersionName(packageName) == null) FAILED_NOT_INSTALLED + else NOT_YET_BACKED_UP + } else metadata?.state.toAppBackupState() AppStatus( packageName = packageName, enabled = settingsManager.isBackupEnabled(packageName), icon = getIcon(packageName), name = context.getString(stringId), time = metadata?.time ?: 0, - status = metadata?.state.toAppBackupState(), + status = status, isSpecial = true ) } diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/AppBackupState.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/AppBackupState.kt index fc40595c..2ba287c5 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/AppBackupState.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/AppBackupState.kt @@ -24,7 +24,7 @@ enum class AppBackupState { FAILED_NO_DATA -> context.getString(R.string.backup_app_no_data) FAILED_WAS_STOPPED -> context.getString(R.string.backup_app_was_stopped) FAILED_NOT_ALLOWED -> context.getString(R.string.backup_app_not_allowed) - FAILED_NOT_INSTALLED -> notShownString + FAILED_NOT_INSTALLED -> context.getString(R.string.restore_app_not_installed) FAILED_QUOTA_EXCEEDED -> context.getString(R.string.backup_app_quota_exceeded) }