diff --git a/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java b/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java index 5bcce579795..893b56e0b6b 100644 --- a/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java +++ b/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java @@ -39,6 +39,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; +import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) public class SearchIndexableResourcesTest { @@ -89,6 +90,7 @@ public class SearchIndexableResourcesTest { } @Test + @Config(qualifiers = "mcc999") public void testNonIndexableKeys_GetsKeyFromProvider() { mSearchProvider.getSearchIndexableResources().getProviderValues().clear(); mSearchProvider.getSearchIndexableResources().addIndex( diff --git a/tests/robotests/src/com/android/settings/testutils/FakeIndexProvider.java b/tests/robotests/src/com/android/settings/testutils/FakeIndexProvider.java index 910ca54b177..8cd0892aa43 100644 --- a/tests/robotests/src/com/android/settings/testutils/FakeIndexProvider.java +++ b/tests/robotests/src/com/android/settings/testutils/FakeIndexProvider.java @@ -29,8 +29,14 @@ public class FakeIndexProvider implements Indexable { public static final String KEY = "TestKey"; + /** + * The fake SearchIndexProvider. Note that the use of location_settings below implies that tests + * using this should be using the res/xml-mcc999/location_settings.xml or + * res/xml-mcc998/location_settings.xml. Annotate tests with + * {@code @Config(qualifiers = "mcc999")}. + */ public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider(R.xml.sound_settings) { + new BaseSearchIndexProvider(R.xml.location_settings) { @Override public List getNonIndexableKeys(Context context) {