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
Save the settings in more cases to avoid losing setting changes #14266
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sfan5
reviewed
Jan 17, 2024
grorp
changed the title
Android: Fix settings not saving when closing app via "Recents" screen
Save the settings in more cases to avoid losing setting changes
Jan 18, 2024
grorp
commented
Jan 18, 2024
sfan5
approved these changes
Jan 18, 2024
I plan to make this even more reliable by saving settings in activity onStop. |
grorp
force-pushed
the
android-save-settings
branch
from
January 22, 2024 14:51
dc835be
to
0990c55
Compare
This is still a workaround, but with the |
sfan5
reviewed
Jan 22, 2024
grorp
added a commit
to grorp/minetest
that referenced
this pull request
Apr 15, 2024
…cially on Android) (minetest#14266)
grorp
added a commit
to grorp/minetest
that referenced
this pull request
Apr 15, 2024
…cially on Android) (minetest#14266)
grorp
added a commit
to grorp/minetest
that referenced
this pull request
Apr 21, 2024
…cially on Android) (minetest#14266)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #14229.
On Android, closing the app via the "Recents screen" won't result in a clean shutdown, discarding any setting changes made by the user.
To avoid that, this PR writes the settings file in some more cases on all platforms, and in even more cases on Android (see the diff). My changes were originally limited to the Android version to avoid problems with multiple instances of Minetest running at the same time, but sfan5 said that doesn't matter.
Note that there are probably still some cases where you can lose setting changes because this is just a workaround.While this is still a workaround, it should be 99.99% reliable now.An alternative approach would be to ensure a clean shutdown when closing the app from the "Recents screen", but that's much more complicated (as far as I can tell) and I'd like to fix this bug sooner rather than later.
To do
This PR is a Ready for Review.
How to test
Close Minetest on Android from the "Recents screen". Verify that any setting changes you've made are persisted.