From 96d04e582bf65c2c3214c063cab894fa40131f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 7 Aug 2021 10:47:11 +0200 Subject: [PATCH 1/2] Only pop up the config save error after main and settings screens. --- Core/Config.cpp | 1 - UI/GameSettingsScreen.cpp | 5 ++++- UI/MainScreen.cpp | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 27bfd3b5cb..21208ea10f 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1490,7 +1490,6 @@ bool Config::Save(const char *saveReason) { if (!iniFile.Save(iniFilename_)) { ERROR_LOG(LOADER, "Error saving config (%s)- can't write ini '%s'", saveReason, iniFilename_.c_str()); - System_SendMessage("toast", "Failed to save settings!\nCheck permissions, or try to restart the device."); return false; } INFO_LOG(LOADER, "Config saved (%s): '%s'", saveReason, iniFilename_.c_str()); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 6b1e97e368..5f35d37b78 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1232,7 +1232,10 @@ void GameSettingsScreen::onFinish(DialogResult result) { Reporting::Enable(enableReports_, "report.ppsspp.org"); Reporting::UpdateConfig(); - g_Config.Save("GameSettingsScreen::onFinish"); + if (!g_Config.Save("GameSettingsScreen::onFinish")) { + System_SendMessage("toast", "Failed to save settings!\nCheck permissions, or try to restart the device."); + } + if (editThenRestore_) { // In case we didn't have the title yet before, try again. std::shared_ptr info = g_gameInfoCache->GetInfo(nullptr, gamePath_, 0); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 4009dc7c42..ef5847c7c4 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1409,7 +1409,9 @@ UI::EventReturn MainScreen::OnForums(UI::EventParams &e) { UI::EventReturn MainScreen::OnExit(UI::EventParams &e) { // Let's make sure the config was saved, since it may not have been. - g_Config.Save("MainScreen::OnExit"); + if (!g_Config.Save("MainScreen::OnExit")) { + System_SendMessage("toast", "Failed to save settings!\nCheck permissions, or try to restart the device."); + } // Request the framework to exit cleanly. System_SendMessage("finish", ""); From 7c1c06ed66cc1bf728ba93fe690d777d54e4f73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 7 Aug 2021 11:00:44 +0200 Subject: [PATCH 2/2] If in legacy storage mode from an earlier install, we still might need to ask for permission. So can't cap on that, until Android removes legacy storage access entirely, probably in Android 13... Should help nassau-tk's issue in #13847. --- android/AndroidManifest.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 833ed5827b..f4f594b79f 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -19,8 +19,11 @@ - - + + + +