Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2163d44 authored by tibbi's avatar tibbi
Browse files

adding a crashfix at getting OTG files

parent 23581d9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.12.16'
        propVersionName = '3.12.17'
        kotlin_version = '1.2.21'
        support_libs = '27.0.2'
    }
+6 −4
Original line number Diff line number Diff line
@@ -310,6 +310,7 @@ fun Context.getOTGItems(path: String, countHiddenItems: Boolean, getProperFileSi
        if (first != null) {
            val fullPath = first.uri.toString()
            val nameStartIndex = fullPath.lastIndexOf(first.name)
            if (fullPath.length > nameStartIndex) {
                var basePath = fullPath.substring(0, nameStartIndex)
                if (basePath.endsWith("%3A")) {
                    basePath = basePath.substring(0, basePath.length - 3)
@@ -317,6 +318,7 @@ fun Context.getOTGItems(path: String, countHiddenItems: Boolean, getProperFileSi
                baseConfig.OTGBasePath = basePath
            }
        }
    }

    val basePath = "${baseConfig.OTGBasePath}%3A"
    for (file in files) {