Merge pull request #689 from grote/687-restore-provider-kill
Don't try to restore storage providing app
This commit is contained in:
commit
cba160bc8f
2 changed files with 10 additions and 3 deletions
|
@ -24,6 +24,7 @@ import com.stevesoltys.seedvault.NO_DATA_END_SENTINEL
|
||||||
import com.stevesoltys.seedvault.R
|
import com.stevesoltys.seedvault.R
|
||||||
import com.stevesoltys.seedvault.metadata.PackageMetadataMap
|
import com.stevesoltys.seedvault.metadata.PackageMetadataMap
|
||||||
import com.stevesoltys.seedvault.metadata.PackageState
|
import com.stevesoltys.seedvault.metadata.PackageState
|
||||||
|
import com.stevesoltys.seedvault.plugins.StoragePluginManager
|
||||||
import com.stevesoltys.seedvault.restore.install.isInstalled
|
import com.stevesoltys.seedvault.restore.install.isInstalled
|
||||||
import com.stevesoltys.seedvault.settings.SettingsManager
|
import com.stevesoltys.seedvault.settings.SettingsManager
|
||||||
import com.stevesoltys.seedvault.transport.TRANSPORT_ID
|
import com.stevesoltys.seedvault.transport.TRANSPORT_ID
|
||||||
|
@ -54,6 +55,7 @@ internal class AppDataRestoreManager(
|
||||||
private val backupManager: IBackupManager,
|
private val backupManager: IBackupManager,
|
||||||
private val settingsManager: SettingsManager,
|
private val settingsManager: SettingsManager,
|
||||||
private val restoreCoordinator: RestoreCoordinator,
|
private val restoreCoordinator: RestoreCoordinator,
|
||||||
|
private val storagePluginManager: StoragePluginManager,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private var session: IRestoreSession? = null
|
private var session: IRestoreSession? = null
|
||||||
|
@ -97,12 +99,16 @@ internal class AppDataRestoreManager(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val providerPackageName = storagePluginManager.appPlugin.providerPackageName
|
||||||
val observer = RestoreObserver(
|
val observer = RestoreObserver(
|
||||||
restoreCoordinator = restoreCoordinator,
|
restoreCoordinator = restoreCoordinator,
|
||||||
restorableBackup = restorableBackup,
|
restorableBackup = restorableBackup,
|
||||||
session = session,
|
session = session,
|
||||||
// sort packages (reverse) alphabetically, since we move from bottom to top
|
// 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,
|
monitor = monitor,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,9 @@ internal class RestoreViewModel(
|
||||||
|
|
||||||
private val appSelectionManager =
|
private val appSelectionManager =
|
||||||
AppSelectionManager(app, pluginManager, iconManager, viewModelScope)
|
AppSelectionManager(app, pluginManager, iconManager, viewModelScope)
|
||||||
private val appDataRestoreManager =
|
private val appDataRestoreManager = AppDataRestoreManager(
|
||||||
AppDataRestoreManager(app, backupManager, settingsManager, restoreCoordinator)
|
app, backupManager, settingsManager, restoreCoordinator, pluginManager
|
||||||
|
)
|
||||||
|
|
||||||
private val mDisplayFragment = MutableLiveEvent<DisplayFragment>()
|
private val mDisplayFragment = MutableLiveEvent<DisplayFragment>()
|
||||||
internal val displayFragment: LiveEvent<DisplayFragment> = mDisplayFragment
|
internal val displayFragment: LiveEvent<DisplayFragment> = mDisplayFragment
|
||||||
|
|
Loading…
Reference in a new issue