Prevent failed dynamic index
In the original design, if a controller in page initializes failed, then it will impact all the dynamic index mechanism. In this change, we will only skip controllers in a specfic page. All other pages which controllers initialize correctly should work proerly. Test: See correct dynamic result Bug: 185325344 Change-Id: I4f959a23635739e1064318ccdddd6d97016dac23
This commit is contained in:
@@ -128,8 +128,13 @@ public class BaseSearchIndexProvider implements Indexable.SearchIndexProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
|
public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
|
||||||
final List<AbstractPreferenceController> controllersFromCode =
|
List<AbstractPreferenceController> controllersFromCode = new ArrayList<>();
|
||||||
createPreferenceControllers(context);
|
try {
|
||||||
|
controllersFromCode = createPreferenceControllers(context);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.w(TAG, "Error initial controller");
|
||||||
|
}
|
||||||
|
|
||||||
final List<SearchIndexableResource> res = getXmlResourcesToIndex(context, true);
|
final List<SearchIndexableResource> res = getXmlResourcesToIndex(context, true);
|
||||||
if (res == null || res.isEmpty()) {
|
if (res == null || res.isEmpty()) {
|
||||||
return controllersFromCode;
|
return controllersFromCode;
|
||||||
|
Reference in New Issue
Block a user