fix Everything is lost when the app is killed in background for android
Guidelines
- Rebase before opening a pull request
- If you are sending several unrelated fixes or features, use a branch and a separate pull request for each
- If possible try squashing everything in a single commit. This is particularly beneficial in the case of feature merges since it allows easy bisecting when a problem arises
Description
When RetroArch Android is closed by swiping up in Android task switcher, or automatically by the background task killer all progress in RetroArch is lost
Expected behavior There should be an option (or always on) that flush in memory states to disk on activity onStop()
Flush SRAM to disk If auto save state is on, make a save state Flush auto save state to disk Looking at uwp/uwp_main.cpp App::OnSuspending it seems like similar behavior was implemented for UWP, but not Android
Related Issues
Actual behavior Everything is lost when the app is killed in background
Steps to reproduce the bug Play a game in Retroarch Switch to 5 other apps Android should've killed Retroarch at this point Go back to Retroarch. It appears as fresh instance without the game running and all progress are lost
Related Pull Requests
[Any other PRs from related repositories that might be needed for this pull request to work]
Reviewers
[If possible @mention all the people that should review your pull request]