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

Commit 6d6ac1de authored by Tony Huang's avatar Tony Huang
Browse files

Make global search file not movable

In current multi root loader design, it cannot delete file,
make them not movable first to avoid confuse user.

Fix: 130233470
Test: atest DocumentsUIGoogleTests
Change-Id: Ic13f1c3112411523820c3caa44c0b358866655d8
parent e8b5fce4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ public abstract class MultiRootDocumentsLoader extends AsyncTaskLoader<Directory
    }

    protected boolean isDocumentsMovable() {
        return true;
        return false;
    }

    protected abstract QueryTask getQueryTask(String authority, List<RootInfo> rootInfos);
+0 −5
Original line number Diff line number Diff line
@@ -64,11 +64,6 @@ public class RecentsLoader extends MultiRootDocumentsLoader {
        return !root.isLocalOnly() || !root.supportsRecents();
    }

    @Override
    protected boolean isDocumentsMovable() {
        return false;
    }

    @Override
    protected QueryTask getQueryTask(String authority, List<RootInfo> rootInfos) {
        return new RecentsTask(authority, rootInfos);
+4 −2
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ public class GlobalSearchLoaderTest {
    }

    @Test
    public void testSearchResult_isMovable() {
    public void testSearchResult_isNotMovable() {
        final DirectoryResult result = mLoader.loadInBackground();

        final Cursor c = result.cursor;
@@ -165,7 +165,9 @@ public class GlobalSearchLoaderTest {

        c.moveToNext();
        final int flags = c.getInt(c.getColumnIndex(Document.COLUMN_FLAGS));
        assertEquals(FILE_FLAG, flags);
        assertEquals(0, flags & Document.FLAG_SUPPORTS_DELETE);
        assertEquals(0, flags & Document.FLAG_SUPPORTS_REMOVE);
        assertEquals(0, flags & Document.FLAG_SUPPORTS_MOVE);
    }

    @Test