Delegate PrintServicesLoader to the framework's one

1. Remove the duplicated PrintServicesLoader in Settings
2. Make a androidx.loader in Settings and internally just delegate all calls to the real PrintServicesLoader
3. Get the result from the real loader

Test: manual
Fixes: 111581651
Change-Id: I2a9b3653f5c68f8383a468cd16ef5f7c3fd4bc3a
This commit is contained in:
Jason Chiu
2018-07-18 16:39:29 +08:00
parent ec7a9df676
commit 104e04dab4
4 changed files with 84 additions and 128 deletions

View File

@@ -286,7 +286,7 @@ public class PrintServiceSettingsFragment extends SettingsPreferenceFragment
@Override
public Loader<List<PrintServiceInfo>> onCreateLoader(int id, Bundle args) {
return new PrintServicesLoader(
return new SettingsPrintServicesLoader(
(PrintManager) getContext().getSystemService(Context.PRINT_SERVICE), getContext(),
PrintManager.ALL_SERVICES);
}