Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to restore storage providing app #689

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.stevesoltys.seedvault.NO_DATA_END_SENTINEL
import com.stevesoltys.seedvault.R
import com.stevesoltys.seedvault.metadata.PackageMetadataMap
import com.stevesoltys.seedvault.metadata.PackageState
import com.stevesoltys.seedvault.plugins.StoragePluginManager
import com.stevesoltys.seedvault.restore.install.isInstalled
import com.stevesoltys.seedvault.settings.SettingsManager
import com.stevesoltys.seedvault.transport.TRANSPORT_ID
Expand Down Expand Up @@ -54,6 +55,7 @@ internal class AppDataRestoreManager(
private val backupManager: IBackupManager,
private val settingsManager: SettingsManager,
private val restoreCoordinator: RestoreCoordinator,
private val storagePluginManager: StoragePluginManager,
) {

private var session: IRestoreSession? = null
Expand Down Expand Up @@ -97,12 +99,16 @@ internal class AppDataRestoreManager(
return
}

val providerPackageName = storagePluginManager.appPlugin.providerPackageName
val observer = RestoreObserver(
restoreCoordinator = restoreCoordinator,
restorableBackup = restorableBackup,
session = session,
// sort packages (reverse) alphabetically, since we move from bottom to top
packages = restorableBackup.packageMetadataMap.packagesSortedByNameDescending,
packages = restorableBackup.packageMetadataMap.packagesSortedByNameDescending.filter {
// filter out current plugin package name, so it doesn't kill our restore
it != providerPackageName
},
monitor = monitor,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ internal class RestoreViewModel(

private val appSelectionManager =
AppSelectionManager(app, pluginManager, iconManager, viewModelScope)
private val appDataRestoreManager =
AppDataRestoreManager(app, backupManager, settingsManager, restoreCoordinator)
private val appDataRestoreManager = AppDataRestoreManager(
app, backupManager, settingsManager, restoreCoordinator, pluginManager
)

private val mDisplayFragment = MutableLiveEvent<DisplayFragment>()
internal val displayFragment: LiveEvent<DisplayFragment> = mDisplayFragment
Expand Down
Loading