From d25eacdf83173d1014c518e8309c70ea364da418 Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Tue, 6 Jan 2026 18:24:06 +0000 Subject: [PATCH] RemovableStorageHelper.kt: Add /storage/ as external storage mount path --- .../citra_emu/utils/RemovableStorageHelper.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/citra_emu/utils/RemovableStorageHelper.kt b/src/android/app/src/main/java/org/citra/citra_emu/utils/RemovableStorageHelper.kt index 80e1d8944..82c4b9ffd 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/utils/RemovableStorageHelper.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/utils/RemovableStorageHelper.kt @@ -10,16 +10,20 @@ import java.io.File object RemovableStorageHelper { // This really shouldn't be necessary, but the Android API seemingly // doesn't have a way of doing this? - // Apparently, on certain devices the mount location can vary, so add - // extra cases here if we discover any new ones. fun getRemovableStoragePath(idString: String): String? { BuildUtil.assertNotGooglePlay() - var pathFile: File + // On certain Android flavours the external storage mount location can + // vary, so add extra cases here if we discover them. + val possibleMountPaths = listOf("/mnt/media_rw/$idString", "/storage/$idString") - pathFile = File("/mnt/media_rw/$idString"); - if (pathFile.exists()) { - return pathFile.absolutePath + for (mountPath in possibleMountPaths) { + val pathFile = File(mountPath); + if (pathFile.exists()) { + // TODO: Cache which mount location is being used for the remainder of the + // session, as it should never change. -OS + return pathFile.absolutePath + } } return null