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

Commit 3c13b4f4 authored by Tony Huang's avatar Tony Huang Committed by Android (Google) Code Review
Browse files

Merge "Make documents diabled when CopyTo or MoveTo flow"

parents 1d2ff700 9c3c60b4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ final class Config extends ActivityConfig {
        }

        switch (state.action) {
            case ACTION_PICK_COPY_DESTINATION:
                return false;
            case ACTION_CREATE:
                // Read-only files are disabled when creating.
                if ((docFlags & Document.FLAG_SUPPORTS_WRITE) == 0) {
+13 −0
Original line number Diff line number Diff line
@@ -408,4 +408,17 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> {
        // Check that copied files exist
        assertFilesCopied(mSdCardLabel, mSdCardRoot, mStorageDocsHelper);
    }

    public void testCopyDocuments_documentsDisabled() throws Exception {
        mDocsHelper.createDocument(rootDir0, "text/plain", fileName1);
        bots.roots.openRoot(StubProvider.ROOT_0_ID);
        bots.directory.selectDocument(fileName1, 1);
        device.waitForIdle();
        bots.main.clickToolbarOverflowItem(context.getResources().getString(R.string.menu_copy));
        device.waitForIdle();
        bots.roots.openRoot(StubProvider.ROOT_0_ID);
        device.waitForIdle();

        assertFalse(bots.directory.findDocument(fileName1).isEnabled());
    }
}