Android: Fix race/crash when switching away/back to the emulation activity

This commit is contained in:
Connor McLaughlin
2020-10-27 11:58:46 +10:00
parent 80a377d45a
commit 7ce55ca800
4 changed files with 13 additions and 8 deletions

View File

@ -447,6 +447,11 @@ void AndroidHostInterface::SurfaceChanged(ANativeWindow* surface, int format, in
wi.surface_height = height;
m_display->ChangeRenderWindow(wi);
if (surface && System::GetState() == System::State::Paused)
System::SetState(System::State::Running);
else if (!surface && System::IsRunning())
System::SetState(System::State::Paused);
}
}
@ -523,7 +528,8 @@ void AndroidHostInterface::SetControllerAxisState(u32 index, s32 button_code, fl
false);
}
void AndroidHostInterface::RefreshGameList(bool invalidate_cache, bool invalidate_database, ProgressCallback* progress_callback)
void AndroidHostInterface::RefreshGameList(bool invalidate_cache, bool invalidate_database,
ProgressCallback* progress_callback)
{
m_game_list->SetSearchDirectoriesFromSettings(m_settings_interface);
m_game_list->Refresh(invalidate_cache, invalidate_database, progress_callback);