make OTG uri permission persistable too
This commit is contained in:
parent
bc63c0cc28
commit
5a431684d0
1 changed files with 3 additions and 0 deletions
|
@ -171,6 +171,9 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
|
|||
baseConfig.OTGPartition = baseConfig.OTGTreeUri.removeSuffix("%3A").substringAfterLast('/').trimEnd('/')
|
||||
baseConfig.OTGPath = "/storage/${baseConfig.OTGPartition}"
|
||||
|
||||
val takeFlags = Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
|
||||
applicationContext.contentResolver.takePersistableUriPermission(resultData.data, takeFlags)
|
||||
|
||||
funAfterOTGPermission?.invoke(true)
|
||||
funAfterOTGPermission = null
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue