diff --git a/app/src/main/java/com/stevesoltys/seedvault/restore/install/ApkRestore.kt b/app/src/main/java/com/stevesoltys/seedvault/restore/install/ApkRestore.kt index c499d0713..0c66fe4d5 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/restore/install/ApkRestore.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/restore/install/ApkRestore.kt @@ -38,14 +38,12 @@ internal class ApkRestore( private val pm = context.packageManager - @Suppress("BlockingMethodInNonBlockingContext") fun restore(backup: RestorableBackup) = flow { - // filter out packages without APK and get total + // we don't filter out apps without APK, so the user can manually install them val packages = backup.packageMetadataMap.filter { - // We also need to exclude the DocumentsProvider used to retrieve backup data. + // We need to exclude the DocumentsProvider used to retrieve backup data. // Otherwise, it gets killed when we install it, terminating our restoration. - val isStorageProvider = it.key == storagePlugin.providerPackageName - it.value.hasApk() && !isStorageProvider + it.key != storagePlugin.providerPackageName } val total = packages.size var progress = 0 @@ -66,7 +64,11 @@ internal class ApkRestore( // re-install individual packages and emit updates for ((packageName, metadata) in packages) { try { - restore(this, backup, packageName, metadata, installResult) + if (metadata.hasApk()) { + restore(this, backup, packageName, metadata, installResult) + } else { + emit(installResult.fail(packageName)) + } } catch (e: IOException) { Log.e(TAG, "Error re-installing APK for $packageName.", e) emit(installResult.fail(packageName)) diff --git a/app/src/main/java/com/stevesoltys/seedvault/worker/BackupRequester.kt b/app/src/main/java/com/stevesoltys/seedvault/worker/BackupRequester.kt index 9eac74069..02d4cc3bf 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/worker/BackupRequester.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/worker/BackupRequester.kt @@ -102,7 +102,7 @@ internal class BackupRequester( (packageIndex + NUM_PACKAGES_PER_TRANSACTION).coerceAtMost(packages.size) val packageChunk = packages.subList(packageIndex, nextChunkIndex).toTypedArray() val numBackingUp = packageIndex + packageChunk.size - Log.i(TAG, "Requesting backup for $numBackingUp/${packages.size} packages...") + Log.i(TAG, "Requesting backup for $numBackingUp of ${packages.size} packages...") packageIndex += packageChunk.size return packageChunk }