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

Commit 26c02580 authored by Bo Majewski's avatar Bo Majewski
Browse files

[DocsUI, Search]: Fix crash due to arg check.

SearchLoader should not be used with no limits on query. However, due to
the way MIME type filtering works (or rather does not work when asking
for /children of a folder) any MIME type filtering is consider
searching. Thus the current check is too aggressive. Removing the check
and disabling the test until proper solution is implemented.

Test: m DocumentsUIGoogle
Bug: 398759887
Flag: com.android.documentsui.flags.use_search_v2_rw
Change-Id: I262502ef5e77bb9791e6b79c188c6ab7d5904883
parent 872138dc
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -68,12 +68,6 @@ class SearchLoader(
    private val mExecutorService: ExecutorService,
) : BaseFileLoader(context, userIdList, mimeTypeLookup) {

    init {
        require((mQuery !== null && !mQuery.isBlank()) || mOptions.maxLastModifiedDelta !== null) {
            "Either the query or the last modified time must not be null"
        }
    }

    /**
     * Helper class that runs query on a single user for the given parameter. This class implements
     * an abstract future so that if the task is completed, we can retrieve the cursor via the get
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import java.util.concurrent.Executors
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertThrows
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -119,6 +120,7 @@ class SearchLoaderTest(private val testParams: LoaderTestParams) : BaseLoaderTes

    @Test
    @RequiresFlagsEnabled(FLAG_USE_SEARCH_V2_RW)
    @Ignore("b/397095797")
    fun testBlankQueryAndRecency() {
        val userIds = listOf(TestProvidersAccess.DOWNLOADS.userId)
        val rootIds = listOf(TestProvidersAccess.DOWNLOADS)