From f5ee1af309014c70b229c5c21d682c31986d2ed6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 25 Sep 2021 20:40:34 -0700 Subject: [PATCH] Android: Create default folders in custom path. If scoped storage is off and the memstick directory was customized, load it before pre-creating default folders. --- UI/NativeApp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index aad079bf88..4bb1c4236a 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -518,7 +518,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch } else { g_Config.memStickDirectory = Path(external_dir); g_Config.defaultCurrentDirectory = Path(external_dir); - CreateDirectoriesAndroid(); } // Might also add an option to move it to internal / non-visible storage, but there's @@ -548,6 +547,11 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch INFO_LOG(SYSTEM, "No memstick directory file found (tried to open '%s')", memstickDirFile.c_str()); } + // Attempt to create directories after reading the path. + if (!System_GetPropertyBool(SYSPROP_ANDROID_SCOPED_STORAGE)) { + CreateDirectoriesAndroid(); + } + #elif PPSSPP_PLATFORM(IOS) g_Config.defaultCurrentDirectory = g_Config.internalDataDirectory; g_Config.memStickDirectory = Path(user_data_path);