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

Commit 1dbe0ac9 authored by Abhijeet Kaur's avatar Abhijeet Kaur Committed by Automerger Merge Worker
Browse files

Merge "Enable manage mode for ExternalStorageProvider when called from Files"...

Merge "Enable manage mode for ExternalStorageProvider when called from Files" into rvc-dev am: aef23c0e am: 36572d3a am: 7cd57521 am: 7a0864e3

Change-Id: I8d3ec3899f2fe753b9e6ef04d3495ed4c1f297f4
parents 47f5abb2 7a0864e3
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -27,11 +27,17 @@ public final class Config extends ActivityConfig {

    @Override
    public boolean managedModeEnabled(DocumentStack stack) {
        // This method helps us understand when to kick in special manage mode behaviors.
        final RootInfo root = stack.getRoot();

        // When in Files activity, allow External Storage provider to view
        // Android/[data|obb|sandbox] directories which are otherwise hidden for privacy reasons.
        if (root != null && root.isExternalStorage()) {
            return true;
        }
        // When in downloads top level directory, we also show active downloads.
        // And while we don't allow folders in Downloads, we do allow Zip files in
        // downloads that themselves can be opened and viewed like directories.
        // This method helps us understand when to kick in on those special behaviors.
        final RootInfo root = stack.getRoot();
        return root != null
                && root.isDownloads()
                && stack.size() == 1;