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

@@ -222,6 +222,7 @@ public class InputMethodAndLanguageSettings extends DashboardFragment
InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(
Context.INPUT_METHOD_SERVICE);
// TODO: Move to VirtualKeyboardFragment and AvailableVirtualKeyboardFragment.
// All other IMEs.
List<InputMethodInfo> inputMethods = immValues.getInputMethodList();
final int inputMethodCount = (inputMethods == null ? 0 : inputMethods.size());
@@ -245,6 +246,7 @@ public class InputMethodAndLanguageSettings extends DashboardFragment
indexables.add(indexable);
}
// TODO: Move to PhysicalKeyboardFragment.
// Hard keyboards
InputManager inputManager = (InputManager) context.getSystemService(
Context.INPUT_SERVICE);