check android version too ad editing SD card content

This commit is contained in:
tibbi
2016-11-05 16:09:01 +01:00
parent e511702fd5
commit b3e0dceff6
2 changed files with 6 additions and 1 deletions

View File

@ -136,7 +136,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
fun checkStupidAndroidFiveSDCardWritePermission(pickedPath: String): Boolean {
val file = File(pickedPath)
return if (!file.canWrite() && Utils.isPathOnSD(applicationContext, pickedPath) && mConfig.treeUri.isEmpty()) {
return if (!file.canWrite() && Utils.needsStupidWritePermissions(applicationContext, pickedPath) && mConfig.treeUri.isEmpty()) {
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
startActivityForResult(intent, OPEN_DOCUMENT_TREE)
false