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

Commit 00ca50e1 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6534410 from 4f4bcea8 to sc-d1-release

Change-Id: I67f9d18b5c73663c5919c1d5f3189ea930b3e3c3
parents a657e1e4 4f4bcea8
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.documentsui.files;
import com.android.documentsui.ActivityConfig;
import com.android.documentsui.base.DocumentStack;
import com.android.documentsui.base.RootInfo;
import com.android.documentsui.util.VersionUtils;

/**
 * Provides support for Files activity specific specializations.
@@ -27,11 +28,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 (VersionUtils.isAtLeastR() && 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;