Fix bug #14118555 NPE in settings app when it is launched by UiAutomator

- prevent the potential NPE

Change-Id: I428f49c4ee55fb1e8fe121b27dd12e21eced4dad
This commit is contained in:
Fabrice Di Meglio
2014-04-16 17:18:24 -07:00
parent a32707664f
commit 0bae067a99

View File

@@ -596,6 +596,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
final int serviceCount = services.size();
for (int i = 0; i < serviceCount; i++) {
AccessibilityServiceInfo service = services.get(i);
if (service == null || service.getResolveInfo() == null) {
continue;
}
SearchIndexableRaw indexable = new SearchIndexableRaw(context);
indexable.title = service.getResolveInfo().loadLabel(packageManager).toString();
indexable.summaryOn = context.getString(R.string.accessibility_feature_state_on);