fix #1523, check SAF dialog at restoring recycle bin items to SD cards

This commit is contained in:
tibbi 2019-08-10 21:59:39 +02:00
parent 2de3e9abc4
commit 51260d351f

View file

@ -256,11 +256,15 @@ fun BaseSimpleActivity.restoreRecycleBinPath(path: String, callback: () -> Unit)
fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList<String>, mediumDao: MediumDao = galleryDB.MediumDao(), callback: () -> Unit) {
ensureBackgroundThread {
val newPaths = ArrayList<String>()
paths.forEach {
val source = it
val destination = it.removePrefix(recycleBinPath)
for (source in paths) {
val destination = source.removePrefix(recycleBinPath)
val lastModified = File(source).lastModified()
val isShowingSAF = handleSAFDialog(destination) {}
if (isShowingSAF) {
return@ensureBackgroundThread
}
var inputStream: InputStream? = null
var out: OutputStream? = null
try {