1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Fix storage scope for the obb directory

This commit is contained in:
Fredia Huya-Kouadio
2025-12-10 21:58:40 -08:00
parent 14e840dd75
commit b40afd6781

View File

@@ -77,6 +77,7 @@ internal enum class StorageScope {
private val internalAppDir: String? = context.filesDir.canonicalPath
private val internalCacheDir: String? = context.cacheDir.canonicalPath
private val externalAppDir: String? = context.getExternalFilesDir(null)?.canonicalPath
private val obbDir: String? = context.obbDir.canonicalPath
private val sharedDir : String? = Environment.getExternalStorageDirectory().canonicalPath
private val downloadsSharedDir: String? = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).canonicalPath
private val documentsSharedDir: String? = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).canonicalPath
@@ -140,6 +141,10 @@ internal enum class StorageScope {
return APP
}
if (obbDir != null && canonicalPathFile.startsWith(obbDir)) {
return APP
}
if (sharedDir != null && canonicalPathFile.startsWith(sharedDir)) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
// Before R, apps had access to shared storage so long as they have the right