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:
@@ -1061,10 +1061,11 @@ public class DatabaseIndexingManager {
|
||||
* Returns the doc id for this row.
|
||||
*/
|
||||
public int getDocId() {
|
||||
// The DocID should contains more than the title string itself (you may have two
|
||||
// settings with the same title). So we need to use a combination of multiple
|
||||
// attributes from this row.
|
||||
return Objects.hash(updatedTitle, screenTitle, key, payloadType);
|
||||
// Eventually we want all DocIds to be the data_reference key. For settings values,
|
||||
// this will be preference keys, and for non-settings they should be unique.
|
||||
return TextUtils.isEmpty(key)
|
||||
? Objects.hash(updatedTitle, className, screenTitle, intentTargetClass)
|
||||
: key.hashCode();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
Reference in New Issue
Block a user