Fix search non-indexable update

- When creating preference conotrollers, if one fail, skip that one
  instead of giving up entire operation.
- Fix BatterySaverController by providing a existing looper.

Change-Id: Iefe443b7fa91e51515c5c247fab4d9588867baef
Fixes: 73903739
Test: robotest
This commit is contained in:
Fan Zhang
2018-02-27 16:05:02 -08:00
parent 8e6d5ad27e
commit f609cad6f0
7 changed files with 89 additions and 14 deletions

View File

@@ -78,8 +78,10 @@ public class BaseSearchIndexProvider implements Indexable.SearchIndexProvider {
((BasePreferenceController) controller).updateNonIndexableKeys(
nonIndexableKeys);
} else {
throw new IllegalStateException(controller.getClass().getName()
+ " must implement " + PreferenceControllerMixin.class.getName());
Log.e(TAG, controller.getClass().getName()
+ " must implement " + PreferenceControllerMixin.class.getName()
+ " treating the key non-indexable");
nonIndexableKeys.add(controller.getPreferenceKey());
}
}
return nonIndexableKeys;