diff options
author | Raff Tsai <rafftsai@google.com> | 2019-09-12 10:56:13 +0800 |
---|---|---|
committer | Raff Tsai <rafftsai@google.com> | 2019-09-12 11:09:09 +0800 |
commit | 1f30b1cd6771f6bad12408967b4e93fc72850441 (patch) | |
tree | 1a4ecd99ad5dcda8e29be089e0e85f7bbbdf8f73 /src/com/android/settings/location | |
parent | e84a8863d5d29c1c02073ba76121804c5667adc0 (diff) | |
download | packages_apps_Settings-1f30b1cd6771f6bad12408967b4e93fc72850441.tar.gz packages_apps_Settings-1f30b1cd6771f6bad12408967b4e93fc72850441.tar.bz2 packages_apps_Settings-1f30b1cd6771f6bad12408967b4e93fc72850441.zip |
Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
Diffstat (limited to 'src/com/android/settings/location')
3 files changed, 3 insertions, 24 deletions
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java index 21b031b75b..d36eaaddf4 100644 --- a/src/com/android/settings/location/LocationSettings.java +++ b/src/com/android/settings/location/LocationSettings.java @@ -129,14 +129,7 @@ public class LocationSettings extends DashboardFragment { * For Search. */ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider() { - @Override - public List<SearchIndexableResource> getXmlResourcesToIndex( - Context context, boolean enabled) { - final SearchIndexableResource sir = new SearchIndexableResource(context); - sir.xmlResId = R.xml.location_settings; - return Arrays.asList(sir); - } + new BaseSearchIndexProvider(R.xml.location_settings) { @Override public List<AbstractPreferenceController> createPreferenceControllers(Context diff --git a/src/com/android/settings/location/RecentLocationRequestSeeAllFragment.java b/src/com/android/settings/location/RecentLocationRequestSeeAllFragment.java index 9e4a77fdb2..b704cb4de2 100644 --- a/src/com/android/settings/location/RecentLocationRequestSeeAllFragment.java +++ b/src/com/android/settings/location/RecentLocationRequestSeeAllFragment.java @@ -106,14 +106,7 @@ public class RecentLocationRequestSeeAllFragment extends DashboardFragment { * For Search. */ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider() { - @Override - public List<SearchIndexableResource> getXmlResourcesToIndex( - Context context, boolean enabled) { - final SearchIndexableResource sir = new SearchIndexableResource(context); - sir.xmlResId = R.xml.location_recent_requests_see_all; - return Arrays.asList(sir); - } + new BaseSearchIndexProvider(R.xml.location_recent_requests_see_all) { @Override public List<AbstractPreferenceController> getPreferenceControllers(Context diff --git a/src/com/android/settings/location/ScanningSettings.java b/src/com/android/settings/location/ScanningSettings.java index 31ec9553d3..c031f4d85b 100644 --- a/src/com/android/settings/location/ScanningSettings.java +++ b/src/com/android/settings/location/ScanningSettings.java @@ -69,14 +69,7 @@ public class ScanningSettings extends DashboardFragment { * For Search. */ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider() { - @Override - public List<SearchIndexableResource> getXmlResourcesToIndex( - Context context, boolean enabled) { - final SearchIndexableResource sir = new SearchIndexableResource(context); - sir.xmlResId = R.xml.location_scanning; - return Arrays.asList(sir); - } + new BaseSearchIndexProvider(R.xml.location_scanning) { @Override public List<AbstractPreferenceController> createPreferenceControllers(Context |