make sure OTG files pass through needsStupidWritePermissions and handleSAFDialog checks

This commit is contained in:
tibbi 2018-02-15 14:57:50 +01:00
parent b384d1854d
commit 460c33f9b1
3 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ buildscript {
propMinSdkVersion = 16
propTargetSdkVersion = propCompileSdkVersion
propVersionCode = 1
propVersionName = '3.11.36'
propVersionName = '3.11.37'
kotlin_version = '1.2.21'
support_libs = '27.0.2'
}

View file

@ -167,7 +167,7 @@ open class BaseSimpleActivity : AppCompatActivity() {
fun startCustomizationActivity() = startActivity(Intent(this, CustomizationActivity::class.java))
fun handleSAFDialog(path: String, callback: () -> Unit): Boolean {
return if (isShowingSAFDialog(path, baseConfig.treeUri, OPEN_DOCUMENT_TREE)) {
return if (!isPathOnOTG(path) && isShowingSAFDialog(path, baseConfig.treeUri, OPEN_DOCUMENT_TREE)) {
funAfterSAFPermission = callback
true
} else {

View file

@ -111,7 +111,7 @@ fun Context.isPathOnOTG(path: String) = path.startsWith(OTG_PATH)
fun Context.isFileDirItemOnOTG(fileDirItem: FileDirItem) = fileDirItem.path.startsWith(OTG_PATH)
fun Context.needsStupidWritePermissions(path: String) = isPathOnSD(path) && isLollipopPlus()
fun Context.needsStupidWritePermissions(path: String) = (isPathOnSD(path) || isPathOnOTG(path)) && isLollipopPlus()
@SuppressLint("NewApi")
fun Context.hasProperStoredTreeUri(): Boolean {