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

Commit 9c3c60b4 authored by Tony Huang's avatar Tony Huang
Browse files

Make documents diabled when CopyTo or MoveTo flow

While CopyTo or MoveTo flow, documents are all enabled but it will
not present any action after click. It confuse users.
Only enable forlders when action is ACTION_PICK_COPY_DESTINATION.

Bug: 117425641
Test: atest DocumentUITests
Change-Id: I3dda59ff54a782860d4356c8bfdcd93ee47e29f6
parent e6bdbeb0
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());
    }
}