Update columns and AndroidManifest for SPA search

Bug: 253981143
Test: manual, unit test
Change-Id: I4454177f43311c00d7c1d16f8e68e95cf61b4c5e
This commit is contained in:
Binyi Wu
2022-12-12 17:46:53 +08:00
parent 09e7579aec
commit 09d1d69fd4
3 changed files with 15 additions and 1 deletions

View File

@@ -38,7 +38,12 @@
<provider
android:name="com.android.settingslib.spa.search.SpaSearchProvider"
android:authorities="com.android.spa.gallery.search.provider"
android:exported="false">
android:exported="true"
android:grantUriPermissions="true"
android:permission="android.permission.READ_SEARCH_INDEXABLES">
<intent-filter>
<action android:name="android.content.action.SPA_SEARCH_PROVIDER" />
</intent-filter>
</provider>
<provider android:name="com.android.settingslib.spa.slice.SpaSliceProvider"

View File

@@ -76,6 +76,7 @@ enum class QueryEnum(
ColumnEnum.SEARCH_PATH,
ColumnEnum.INTENT_TARGET_PACKAGE,
ColumnEnum.INTENT_TARGET_CLASS,
ColumnEnum.INTENT_EXTRAS,
ColumnEnum.SLICE_URI,
ColumnEnum.LEGACY_KEY
)

View File

@@ -40,6 +40,14 @@ class SpaSearchProviderTest {
private val searchProvider = SpaSearchProvider()
private val pageOwner = spaEnvironment.createPage("SppForSearch")
@Test
fun testQueryColumnSetup() {
Truth.assertThat(QueryEnum.SEARCH_STATIC_DATA_QUERY.columnNames)
.containsExactlyElementsIn(QueryEnum.SEARCH_DYNAMIC_DATA_QUERY.columnNames)
Truth.assertThat(QueryEnum.SEARCH_MUTABLE_STATUS_DATA_QUERY.columnNames)
.containsExactlyElementsIn(QueryEnum.SEARCH_IMMUTABLE_STATUS_DATA_QUERY.columnNames)
}
@Test
fun testQuerySearchStatusData() {
SpaEnvironmentFactory.reset(spaEnvironment)