Android: Fix in-game settings changes not getting saved #9454
+8
−1
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.
EmulationActivityhas an instance ofSettings. If you go toSettingsActivityfromEmulationActivityand change some settings, the changes get saved to disk, butEmulationActivity'sSettingsinstance still contains the old settings in its map of all settings (assuming theEmulationActivitywas not killed by the system to save memory). Then, once you're done playing your game and exitEmulationActivity,EmulationActivitycallsSettings.saveSettings. This call tosaveSettingsfirst overwrites the entire INI file with its map of all settings (which is outdated) in order to save any legacy settings that have changed (which they haven't, since the GUI doesn't let you change legacy settings while a game is running). Then, it asks the new config system to write the most up-to-date values available for non-legacy settings, which should make all the settings be up-to-date again. The problem here is that the new config system would skip writing to disk if no settings changes had been made since the last time we asked it to write to disk (i.e. sinceSettingsActivityexited).NB: Calling
Settings.loadSettingsinEmulationActivity.onResumeis not a working solution. I assume this is becauseSettingsActivitysaves its settings inonStopand notonPause.