Update Settings search result unique ids

- SearchResult stableIds are now DocIds from the database
- DocIds are data reference key's hash, when the key is not
empty or null
- Otherwise, DocIds are a hashcode from a set of fields.

Change-Id: Id36f7bf4ceaaa3a2bd326ecafbfe97fd0b247df2
Fixes: 37327194
Test: make RunSettingsRoboTest
This commit is contained in:
Matthew Fritze
2017-05-12 15:59:19 -07:00
parent 7f2d779e15
commit 6efea1e624
12 changed files with 347 additions and 499 deletions

View File

@@ -95,10 +95,11 @@ public class InstalledAppResultLoader extends AsyncLoader<List<? extends SearchR
final AppSearchResult.Builder builder = new AppSearchResult.Builder();
builder.setAppInfo(info)
.addTitle(info.loadLabel(pm))
.addRank(getRank(wordDiff))
.setStableId(info.packageName.hashCode())
.setTitle(info.loadLabel(pm))
.setRank(getRank(wordDiff))
.addBreadcrumbs(getBreadCrumb())
.addPayload(new ResultPayload(intent));
.setPayload(new ResultPayload(intent));
results.add(builder.build());
}
}