Android: Fix online system update after disc system update

This bug has been in Dolphin for a while now. If you installed a system
update from a disc, attempting to do an online system update afterwards
would result in Dolphin doing a disc update again because the disc path
was never cleared.
This commit is contained in:
JosJuice committed 2026-11-22 11:24:39 +01:00
1 parent a76221bc31
commit c513c109fa
3 files changed
+15 -6

No files matched your search

@@ -24,7 +24,7 @@ class OnlineUpdateRegionSelectDialogFragment : DialogFragment() {
.setSingleChoiceItems(items, checkedItem) { _: DialogInterface?, which: Int ->
val viewModel =
ViewModelProvider(requireActivity())[SystemUpdateViewModel::class.java]
viewModel.region = which
viewModel.prepareOnlineUpdate(which)
SystemUpdateProgressBarDialogFragment().show(
parentFragmentManager,
SystemUpdateProgressBarDialogFragment.TAG
@@ -16,16 +16,25 @@ class SystemUpdateViewModel : ViewModel() {
val totalData = MutableLiveData<Int>()
val titleIdData = MutableLiveData<Long>()
val resultData = MutableLiveData<Int>()
private var isRunning = false
private var canceled = false
var region = -1
var discPath: String = ""
private var region = -1
private var discPath: String = ""
init {
clear()
}
fun prepareOnlineUpdate(region: Int) {
this.region = region
this.discPath = ""
}
fun prepareDiscUpdate(discPath: String) {
this.region = -1
this.discPath = discPath
}
fun setCanceled() {
canceled = true
}
@@ -321,7 +321,7 @@ class MainPresenter(private val mainView: MainView, private val activity: Fragme
private fun launchOnlineUpdate() {
if (WiiUtils.isSystemMenuInstalled()) {
val viewModel = ViewModelProvider(activity)[SystemUpdateViewModel::class.java]
viewModel.region = -1
viewModel.prepareOnlineUpdate(-1)
launchUpdateProgressBarFragment(activity)
} else {
SystemMenuNotInstalledDialogFragment().show(
@@ -357,7 +357,7 @@ class MainPresenter(private val mainView: MainView, private val activity: Fragme
@JvmStatic
fun launchDiscUpdate(path: String, activity: FragmentActivity) {
val viewModel = ViewModelProvider(activity)[SystemUpdateViewModel::class.java]
viewModel.discPath = path
viewModel.prepareDiscUpdate(path)
launchUpdateProgressBarFragment(activity)
}