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

Commit 460c33f9 authored by tibbi's avatar tibbi
Browse files

make sure OTG files pass through needsStupidWritePermissions and handleSAFDialog checks

parent b384d185
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.11.36'
        propVersionName = '3.11.37'
        kotlin_version = '1.2.21'
        support_libs = '27.0.2'
    }
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+1 −1
Original line number Diff line number Diff line
@@ -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 {