Loading src/com/android/settings/search/SettingsSearchIndexablesProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -454,7 +454,7 @@ public class SettingsSearchIndexablesProvider extends SearchIndexablesProvider { // Skip Settings injected items because they should be indexed in the sub-pages. return false; } return true; return tile.isSearchable(); } private static Object[] createIndexableRawColumnObjects(SearchIndexableRaw raw) { Loading tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java +14 −0 Original line number Diff line number Diff line package com.android.settings.search; import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SEARCHABLE; import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_TITLE; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -207,6 +208,19 @@ public class SettingsSearchIndexablesProviderTest { assertThat(mProvider.isEligibleForIndexing(PACKAGE_NAME, activityTile)).isTrue(); } @Test public void isEligibleForIndexing_disabledByMetadata_shouldReturnFalse() { final ActivityInfo activityInfo = new ActivityInfo(); activityInfo.packageName = PACKAGE_NAME; activityInfo.name = "class"; activityInfo.metaData = new Bundle(); activityInfo.metaData.putBoolean(META_DATA_PREFERENCE_SEARCHABLE, false); final ActivityTile activityTile = new ActivityTile(activityInfo, CategoryKey.CATEGORY_CONNECT); assertThat(mProvider.isEligibleForIndexing(PACKAGE_NAME, activityTile)).isFalse(); } @Implements(CategoryManager.class) public static class ShadowCategoryManager { Loading Loading
src/com/android/settings/search/SettingsSearchIndexablesProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -454,7 +454,7 @@ public class SettingsSearchIndexablesProvider extends SearchIndexablesProvider { // Skip Settings injected items because they should be indexed in the sub-pages. return false; } return true; return tile.isSearchable(); } private static Object[] createIndexableRawColumnObjects(SearchIndexableRaw raw) { Loading
tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java +14 −0 Original line number Diff line number Diff line package com.android.settings.search; import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SEARCHABLE; import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_TITLE; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -207,6 +208,19 @@ public class SettingsSearchIndexablesProviderTest { assertThat(mProvider.isEligibleForIndexing(PACKAGE_NAME, activityTile)).isTrue(); } @Test public void isEligibleForIndexing_disabledByMetadata_shouldReturnFalse() { final ActivityInfo activityInfo = new ActivityInfo(); activityInfo.packageName = PACKAGE_NAME; activityInfo.name = "class"; activityInfo.metaData = new Bundle(); activityInfo.metaData.putBoolean(META_DATA_PREFERENCE_SEARCHABLE, false); final ActivityTile activityTile = new ActivityTile(activityInfo, CategoryKey.CATEGORY_CONNECT); assertThat(mProvider.isEligibleForIndexing(PACKAGE_NAME, activityTile)).isFalse(); } @Implements(CategoryManager.class) public static class ShadowCategoryManager { Loading