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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user