Make Print Settings use the new PrintManager.getPrintServices loader
This makes sure that all data always stays up to date. printer_dropdown_item.xml: - Reduce the amount of overriden properties PrintServiceSettingsFragment: - Instead receiving most data from PrintSettingsFragment have own loader and keep data up to date - Also the updating of the print service state now has a dedicated PrintManager call instead of relying of the Settings-ContentObserver to transport this information. No more race-conditions, whohoo! DynamicIndexableContentMonitor: - To not rewrite too much code the update logic has to live here but the reading of the actual data is in PrintSettingsFragment. Change-Id: I60715cda8952565d7f68cb24fb7da61a37085887
This commit is contained in:
@@ -131,6 +131,8 @@ public class SettingsActivity extends SettingsDrawerActivity
|
||||
|
||||
private static final String LOG_TAG = "Settings";
|
||||
|
||||
private static final int LOADER_ID_INDEXABLE_CONTENT_MONITOR = 1;
|
||||
|
||||
// Constants for state save/restore
|
||||
private static final String SAVE_KEY_CATEGORIES = ":settings:categories";
|
||||
private static final String SAVE_KEY_SEARCH_MENU_EXPANDED = ":settings:search_menu_expanded";
|
||||
@@ -786,7 +788,7 @@ public class SettingsActivity extends SettingsDrawerActivity
|
||||
registerReceiver(mUserAddRemoveReceiver, new IntentFilter(Intent.ACTION_USER_ADDED));
|
||||
registerReceiver(mUserAddRemoveReceiver, new IntentFilter(Intent.ACTION_USER_REMOVED));
|
||||
|
||||
mDynamicIndexableContentMonitor.register(this);
|
||||
mDynamicIndexableContentMonitor.register(this, LOADER_ID_INDEXABLE_CONTENT_MONITOR);
|
||||
|
||||
if(mDisplaySearch && !TextUtils.isEmpty(mSearchQuery)) {
|
||||
onQueryTextSubmit(mSearchQuery);
|
||||
|
||||
Reference in New Issue
Block a user