Merge "Update summary for Connected devices->Printing." into oc-dev

am: 4bbfdb13e7

Change-Id: Iec490fa3c38a854d3469d238f1d3acb17196a02d
This commit is contained in:
Doris Ling
2017-04-06 18:43:14 +00:00
committed by android-build-merger
2 changed files with 4 additions and 3 deletions

View File

@@ -529,7 +529,7 @@ public class PrintSettingsFragment extends ProfileSettingsPreferenceFragment
if (mPrintManager != null) {
if (isListening) {
List<PrintServiceInfo> services =
mPrintManager.getPrintServices(PrintManager.ALL_SERVICES);
mPrintManager.getPrintServices(PrintManager.ENABLED_SERVICES);
if (services == null || services.isEmpty()) {
mSummaryLoader.setSummary(this,
mContext.getString(R.string.print_settings_summary_no_service));

View File

@@ -68,14 +68,15 @@ public class PrintSettingsFragmentTest {
when(printServices.isEmpty()).thenReturn(false);
when(printServices.size()).thenReturn(2);
// 2 services
when(mPrintManager.getPrintServices(PrintManager.ALL_SERVICES)).thenReturn(printServices);
when(mPrintManager.getPrintServices(PrintManager.ENABLED_SERVICES))
.thenReturn(printServices);
mSummaryProvider.setListening(true);
verify(mRes).getQuantityString(R.plurals.print_settings_summary, 2, 2);
// No service
when(mPrintManager.getPrintServices(PrintManager.ALL_SERVICES)).thenReturn(null);
when(mPrintManager.getPrintServices(PrintManager.ENABLED_SERVICES)).thenReturn(null);
mSummaryProvider.setListening(true);