Update print jobs appropriately in the print settings.

- Always use a fresh print job as once the print job goes away it cannot
  be read. Before we were stuck with the last state which might not been
  the last state
- make loaders relative to fragment to avoid loader id duplications with
  other ids of the activity.

Fixes: 28315242
Change-Id: I57eeb64b44b5d77b2092c22b175407131f7baf97
This commit is contained in:
Philip P. Moltmann
2016-04-21 15:15:37 -07:00
parent 1624f69ac9
commit eb01628ba8
3 changed files with 19 additions and 21 deletions

View File

@@ -115,12 +115,10 @@ public class PrintSettingsFragment extends ProfileSettingsPreferenceFragment
getPreferenceScreen().removePreference(mActivePrintJobsCategory);
mPrintJobsController = new PrintJobsController();
getActivity().getLoaderManager().initLoader(LOADER_ID_PRINT_JOBS_LOADER, null,
mPrintJobsController);
getLoaderManager().initLoader(LOADER_ID_PRINT_JOBS_LOADER, null, mPrintJobsController);
mPrintServicesController = new PrintServicesController();
getActivity().getLoaderManager().initLoader(LOADER_ID_PRINT_SERVICES, null,
mPrintServicesController);
getLoaderManager().initLoader(LOADER_ID_PRINT_SERVICES, null, mPrintServicesController);
}
@Override
@@ -294,7 +292,7 @@ public class PrintSettingsFragment extends ProfileSettingsPreferenceFragment
@Override
public Loader<List<PrintJobInfo>> onCreateLoader(int id, Bundle args) {
if (id == LOADER_ID_PRINT_JOBS_LOADER) {
return new PrintJobsLoader(getActivity());
return new PrintJobsLoader(getContext());
}
return null;
}