fill the OTGPath when appropriate

This commit is contained in:
tibbi 2019-02-15 12:34:53 +01:00
parent 237dd01e46
commit 8c4ff2f8e4
3 changed files with 3 additions and 1 deletions

View file

@ -7,7 +7,7 @@ buildscript {
propMinSdkVersion = 21
propTargetSdkVersion = propCompileSdkVersion
propVersionCode = 1
propVersionName = '5.7.11'
propVersionName = '5.7.12'
kotlin_version = '1.3.21'
}

View file

@ -169,6 +169,7 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
}
baseConfig.OTGTreeUri = resultData.dataString
baseConfig.OTGPartition = baseConfig.OTGTreeUri.removeSuffix("%3A").substringAfterLast('/')
baseConfig.OTGPath = "/storage${baseConfig.OTGPartition}"
funAfterOTGPermission?.invoke(true)
funAfterOTGPermission = null

View file

@ -195,6 +195,7 @@ fun Context.getOTGFastDocumentFile(path: String): DocumentFile? {
if (baseConfig.OTGPartition.isEmpty()) {
baseConfig.OTGPartition = baseConfig.OTGTreeUri.removeSuffix("%3A").substringAfterLast('/')
baseConfig.OTGPath = "/storage${baseConfig.OTGPartition}"
}
val relativePath = Uri.encode(path.substring(OTG_PATH.length).trim('/'))