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

Commit 8b449f83 authored by tibbi's avatar tibbi
Browse files

do not allow copying files in the recycle bin manually

parent 4b528b5f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '4.5.0'
        propVersionName = '4.5.1'
        kotlin_version = '1.2.51'
        support_libs = '27.1.1'
    }
+7 −2
Original line number Diff line number Diff line
@@ -50,12 +50,17 @@ class FilePickerDialog(val activity: BaseSimpleActivity,
            currPath = currPath.getParentPath()
        }

        // do not allow copying files in the recycle bin manually
        if (currPath.startsWith(activity.filesDir.absolutePath)) {
            currPath = activity.internalStoragePath
        }

        mDialogView.filepicker_breadcrumbs.listener = this
        tryUpdateItems()

        val builder = AlertDialog.Builder(activity)
                .setNegativeButton(R.string.cancel, null)
                .setOnKeyListener({ dialogInterface, i, keyEvent ->
                .setOnKeyListener { dialogInterface, i, keyEvent ->
                    if (keyEvent.action == KeyEvent.ACTION_UP && i == KeyEvent.KEYCODE_BACK) {
                        val breadcrumbs = mDialogView.filepicker_breadcrumbs
                        if (breadcrumbs.childCount > 1) {
@@ -67,7 +72,7 @@ class FilePickerDialog(val activity: BaseSimpleActivity,
                        }
                    }
                    true
                })
                }

        if (!pickFile)
            builder.setPositiveButton(R.string.ok, null)