Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write xml resource id twice. - Remove getPreferenceControllers from Indexable.java. Because it will move to SettingsLib later for other apps which don't need this function Bug: 135053028 Test: robolectric Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
This commit is contained in:
@@ -104,7 +104,7 @@ public final class AccessibilityControlTimeoutPreferenceFragment extends Dashboa
|
||||
return sControllers;
|
||||
}
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.accessibility_control_timeout_settings) {
|
||||
|
||||
@Override
|
||||
|
@@ -32,7 +32,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.DeviceConfig;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArrayMap;
|
||||
@@ -246,7 +245,7 @@ public class AccessibilitySettings extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.accessibility_settings;
|
||||
return SEARCH_INDEX_DATA_PROVIDER.getXmlResourceId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -506,6 +505,6 @@ public class AccessibilitySettings extends DashboardFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.accessibility_settings);
|
||||
}
|
||||
|
@@ -192,7 +192,7 @@ public class AccessibilityShortcutPreferenceFragment extends ToggleFeaturePrefer
|
||||
return ComponentName.unflattenFromString(componentNameString);
|
||||
}
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
// This fragment is for details of the shortcut. Only the shortcut itself needs
|
||||
// to be indexed.
|
||||
|
@@ -167,7 +167,7 @@ public final class MagnificationPreferenceFragment extends DashboardFragment {
|
||||
== NAV_BAR_MODE_GESTURAL;
|
||||
}
|
||||
|
||||
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.accessibility_magnification_settings) {
|
||||
|
||||
@Override
|
||||
|
@@ -187,6 +187,6 @@ public class ToggleAutoclickPreferenceFragment extends ToggleFeaturePreferenceFr
|
||||
return (delay - MIN_AUTOCLICK_DELAY) / AUTOCLICK_DELAY_STEP;
|
||||
}
|
||||
|
||||
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.accessibility_autoclick_settings);
|
||||
}
|
||||
|
@@ -127,7 +127,7 @@ public class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePreferenceF
|
||||
onPreferenceToggled(mPreferenceKey, isChecked);
|
||||
}
|
||||
|
||||
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.accessibility_daltonizer_settings);
|
||||
|
||||
}
|
||||
|
@@ -51,6 +51,6 @@ public class VibrationSettings extends DashboardFragment {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.accessibility_vibration_settings);
|
||||
}
|
||||
|
Reference in New Issue
Block a user