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

Commit c468e86a authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

Enable manage mode for ExternalStorageProvider when called from Files

Bug: 150366834
Test: Android/data and Android/obb is visible from Files App, but are
hidden in Picker view from StorageTestApp and
GMail (GMail > Compose > Attach > Go to Pixel > Android).

Change-Id: I7642101636c7c37c50bd8626be585f7a97b89cd4
parent ec916604
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;