Deal with the case that no print services are installed.

am: 7833d183e7

* commit '7833d183e7ddeaf08938b9db6d8714185e11901f':
  Deal with the case that no print services are installed.
This commit is contained in:
Philip P. Moltmann
2016-03-07 23:59:31 +00:00
committed by android-build-merger

View File

@@ -584,6 +584,8 @@ public class PrintSettingsFragment extends ProfileSettingsPreferenceFragment
// updated until this function is called again // updated until this function is called again
List<PrintServiceInfo> services = List<PrintServiceInfo> services =
printManager.getPrintServices(PrintManager.ALL_SERVICES); printManager.getPrintServices(PrintManager.ALL_SERVICES);
if (services != null) {
final int serviceCount = services.size(); final int serviceCount = services.size();
for (int i = 0; i < serviceCount; i++) { for (int i = 0; i < serviceCount; i++) {
PrintServiceInfo service = services.get(i); PrintServiceInfo service = services.get(i);
@@ -600,6 +602,7 @@ public class PrintSettingsFragment extends ProfileSettingsPreferenceFragment
data.screenTitle = screenTitle; data.screenTitle = screenTitle;
indexables.add(data); indexables.add(data);
} }
}
return indexables; return indexables;
} }