diff options
author | 2025-02-24 22:46:37 +0000 | |
---|---|---|
committer | 2025-02-24 22:58:51 +0000 | |
commit | 26c025802f4635ff288c31874f30657087626146 (patch) | |
tree | e1b4ba904a4104efab13b6b5b29adeef47a09dad | |
parent | 872138dce126c5402606bd426b0eddf953ba9cb0 (diff) |
[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
-rw-r--r-- | src/com/android/documentsui/loaders/SearchLoader.kt | 6 | ||||
-rw-r--r-- | tests/unit/com/android/documentsui/loaders/SearchLoaderTest.kt | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/com/android/documentsui/loaders/SearchLoader.kt b/src/com/android/documentsui/loaders/SearchLoader.kt index 567363697..b17271bdc 100644 --- a/src/com/android/documentsui/loaders/SearchLoader.kt +++ b/src/com/android/documentsui/loaders/SearchLoader.kt @@ -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 diff --git a/tests/unit/com/android/documentsui/loaders/SearchLoaderTest.kt b/tests/unit/com/android/documentsui/loaders/SearchLoaderTest.kt index fdaadcda1..e480337ab 100644 --- a/tests/unit/com/android/documentsui/loaders/SearchLoaderTest.kt +++ b/tests/unit/com/android/documentsui/loaders/SearchLoaderTest.kt @@ -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) |