Move search indexing into a separate class

Step 2 in refactoring DatabaseIndexingManager.

This step moves the insertion of data into the database
into a new class. This removes the remaining bulk of the
code outside of DIM, but it does not fix the actual issue
with the indexing code.

The indexing code still chains functions together to
insert data into the database at the end of the functions.

It is exceedingly hard to read, and hard to track down bugs.

I would like the converter to eventually return a list of
IndexData objects, which lets us dissociate the database
from the data collection. I.e. we can store the database
in the Search app, and just pass IndexData objects via
IPC.Fixing this requires more of a refactor, and will be
done in a subsquent CL.

Bug: 33577327
Test: make RunSettingsRoboTests
Test: Took a database dump before and after change,
      and they were the same. Cool.
Change-Id: Ia9bb815657b76f6cb9163014e746ec5eb6db8c5e
This commit is contained in:
Matthew Fritze
2017-08-22 15:51:50 -07:00
parent 35cfba1fa0
commit 80d3ea2a73
13 changed files with 1536 additions and 1324 deletions

View File

@@ -64,7 +64,7 @@ public class InlineSwitchPayloadTest {
InlineSwitchPayload payload = new InlineSwitchPayload(uri, source, 1, intent, true,
1 /* default */);
final Intent retainedIntent = payload.getIntent();
assertThat(payload.mSettingKey).isEqualTo(uri);
assertThat(payload.getKey()).isEqualTo(uri);
assertThat(payload.getType()).isEqualTo(type);
assertThat(payload.mSettingSource).isEqualTo(source);
assertThat(payload.isStandard()).isTrue();
@@ -93,7 +93,7 @@ public class InlineSwitchPayloadTest {
InlineSwitchPayload payload = InlineSwitchPayload.CREATOR.createFromParcel(parcel);
final Intent builtIntent = payload.getIntent();
assertThat(payload.mSettingKey).isEqualTo(uri);
assertThat(payload.getKey()).isEqualTo(uri);
assertThat(payload.getType()).isEqualTo(type);
assertThat(payload.mSettingSource).isEqualTo(source);
assertThat(payload.isStandard()).isTrue();