Refactor DynamicIndexableContentMonitor

Refactor content monitoring code into a few singletons to keep alive
while Settings app is running.

Bug: 32995210
Test: Manually installing/uninstalling AOSP LatinIME.apk while
      Settings app is/isn't running, then search AOSP.
Test: Connecting/Disconnecting Anker bluetooth keyboard while Settings
      app is/isn't running, then search Anker.
Test: Added Robolectric test for DynamicIndexableContentMonitor.
Change-Id: I588e33be169fc9677d41c3daa59ab400f04f6419
This commit is contained in:
Tadashi G. Takaoka
2016-11-21 14:20:19 +09:00
parent 1df45999a3
commit a034fa5407
9 changed files with 1239 additions and 205 deletions

View File

@@ -723,7 +723,7 @@ public class SettingsActivity extends SettingsDrawerActivity
unregisterReceiver(mBatteryInfoReceiver);
unregisterReceiver(mUserAddRemoveReceiver);
if (mDynamicIndexableContentMonitor != null) {
mDynamicIndexableContentMonitor.unregister();
mDynamicIndexableContentMonitor.unregister(this, LOADER_ID_INDEXABLE_CONTENT_MONITOR);
}
}