Android: Rewrite Wii system updates in Kotlin #11494
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This initially was an attempt at preserving the updater process during configuration changes through coroutines, but afaik that is not possible without changing how the backend works. There is currrently some kind of bug somewhere between the android ndk and our backend that causes a file rename to fail on any kind of configuration change. This includes dark theme toggling, screen size change, or orientation change. I don't currently have the knowledge to fix this bug and I'd prefer to leave it for later. I attempted to cancel and restart the updater during a configuration change, but the error is thrown before I can handle it (at least without handling the entire configuration change myself but that would become clunky).
For now, I have rewritten the android app side of the updater in Kotlin and using a coroutine. This ensures the scope is cancelled properly once the viewmodel is destroyed. I've chosen to remove the orientation lock and let the dialog handle the failure. I believe it's best that we avoid locking device features especially since this can be easily started again without lost progress.
This also includes changing the progress bar to an indeterminate one during the cancellation process.