do not allow setting /storage/emulated/0 as an SD card path

This commit is contained in:
tibbi 2019-12-25 19:18:47 +01:00
parent b1bdbfc3a9
commit 2718207ed1

View file

@ -24,7 +24,7 @@ import java.util.regex.Pattern
// http://stackoverflow.com/a/40582634/1967672
fun Context.getSDCardPath(): String {
val directories = getStorageDirectories().filter {
it != getInternalStoragePath() && (baseConfig.OTGPartition.isEmpty() || !it.endsWith(baseConfig.OTGPartition))
it != getInternalStoragePath() && !it.equals("/storage/emulated/0", true) && (baseConfig.OTGPartition.isEmpty() || !it.endsWith(baseConfig.OTGPartition))
}
val fullSDpattern = Pattern.compile(SD_OTG_PATTERN)