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
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 8dafd74..2bce5b6 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -131,6 +131,8 @@
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 @@
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);