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

Commit 68e75358 authored by Zemiao Zhu's avatar Zemiao Zhu Committed by Automerger Merge Worker
Browse files

Fix cannot open archive file from external storage. am: f4f1e724

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/DocumentsUI/+/12010470

Change-Id: Ie99a347715572789f6a179d1dcfc431a77b7fa10
parents 932f32d2 f4f1e724
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -37,8 +37,9 @@ public abstract class ActivityConfig {
    }
    }


    /**
    /**
     * When managed mode is enabled, active downloads will be visible in the UI.
     * When managed mode is enabled, there will be special UI behaviors:
     * Presumably this should only be true when in the downloads directory.
     * 1) active downloads will be visible in the UI.
     * 2) Android/[data|obb|sandbox] directories will not be hidden.
     */
     */
    public boolean managedModeEnabled(DocumentStack stack) {
    public boolean managedModeEnabled(DocumentStack stack) {
        return false;
        return false;
+15 −7
Original line number Original line Diff line number Diff line
@@ -25,18 +25,18 @@ import android.graphics.Point;
import android.net.Uri;
import android.net.Uri;
import android.os.Bundle;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.CancellationSignal;
import android.os.FileUtils;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
import android.provider.DocumentsContract;
import android.provider.DocumentsContract;
import android.provider.DocumentsContract.Document;
import android.provider.DocumentsContract.Document;
import android.provider.DocumentsContract.Root;
import android.provider.DocumentsContract.Root;
import android.provider.DocumentsProvider;
import android.provider.DocumentsProvider;
import androidx.annotation.Nullable;
import android.util.Log;
import android.util.Log;


import com.android.documentsui.R;
import androidx.annotation.GuardedBy;
import androidx.annotation.GuardedBy;
import androidx.annotation.Nullable;


import android.os.FileUtils;
import com.android.documentsui.R;


import java.io.FileNotFoundException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.IOException;
@@ -129,6 +129,14 @@ public class ArchivesProvider extends DocumentsProvider {
        return cursor;
        return cursor;
    }
    }


    /** Overrides a hidden API. */
    public Cursor queryChildDocumentsForManage(String parentDocumentId,
            @Nullable String[] projection, @Nullable String sortOrder)
            throws FileNotFoundException {
        // No special handling of Archives in managed mode.
        return queryChildDocuments(parentDocumentId, projection, sortOrder);
    }

    @Override
    @Override
    public String getDocumentType(String documentId) throws FileNotFoundException {
    public String getDocumentType(String documentId) throws FileNotFoundException {
        final ArchiveId archiveId = ArchiveId.fromDocumentId(documentId);
        final ArchiveId archiveId = ArchiveId.fromDocumentId(documentId);