Merge pull request #14694 from hrydgard/scoped-storage-fixes

Scoped storage fixes
This commit is contained in:
Henrik Rydgård 2021-08-07 11:42:38 +02:00 committed by GitHub
commit af3ad2ca03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View file

@ -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());

View file

@ -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<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, gamePath_, 0);

View file

@ -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", "");

View file

@ -19,8 +19,11 @@
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
<!-- I tried using android:maxSdkVersion="29" on WRITE/READ_EXTERNAL_STORAGE, but that made
<it so that in legacy mode, you can't ask for permission anymore. So removed that. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="archos.permission.FULLSCREEN.FULL" />