Merge similar BaseSearchIndexProvider code together
Bug: 135053028 Test: robolectric, check search_index.db contains the same items Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
This commit is contained in:
@@ -64,13 +64,5 @@ public class DoubleTapPowerSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final 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.double_tap_power_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.double_tap_power_settings);
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ public class DoubleTapScreenSettings extends DashboardFragment {
|
||||
prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
|
||||
|
||||
use(DoubleTapScreenPreferenceController.class)
|
||||
.setConfig(new AmbientDisplayConfiguration(context));
|
||||
.setConfig(new AmbientDisplayConfiguration(context));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,13 +73,5 @@ public class DoubleTapScreenSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final 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.double_tap_screen_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.double_tap_screen_settings);
|
||||
}
|
||||
|
@@ -49,13 +49,5 @@ public class GlobalActionsPanelSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final 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.global_actions_panel_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.global_actions_panel_settings);
|
||||
}
|
||||
|
@@ -73,14 +73,6 @@ public class PickupGestureSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final 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.pick_up_gesture_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.pick_up_gesture_settings);
|
||||
|
||||
}
|
||||
|
@@ -75,14 +75,7 @@ public class PreventRingingGestureSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final 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.prevent_ringing_gesture_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
new BaseSearchIndexProvider(R.xml.prevent_ringing_gesture_settings) {
|
||||
|
||||
@Override
|
||||
public List<AbstractPreferenceController> createPreferenceControllers(
|
||||
|
@@ -64,14 +64,7 @@ public class SwipeToNotificationSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final 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.swipe_to_notification_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
new BaseSearchIndexProvider(R.xml.swipe_to_notification_settings) {
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
|
@@ -359,14 +359,7 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment {
|
||||
}
|
||||
|
||||
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.system_navigation_gesture_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
new BaseSearchIndexProvider(R.xml.system_navigation_gesture_settings) {
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
|
@@ -68,13 +68,5 @@ public class TapScreenGestureSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
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.tap_screen_gesture_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.tap_screen_gesture_settings);
|
||||
}
|
||||
|
Reference in New Issue
Block a user