summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/search
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-09-02 18:22:09 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2014-09-02 18:31:10 -0700
commit14be7d23a2ee023796126453bba55f4bc84ba065 (patch)
treee4b95b8e8e93973f8aee5d7c8cbf214f025608c8 /src/com/android/settings/search
parentbde55601ba5695894b7f9b8c7f61fd6694f9b459 (diff)
downloadpackages_apps_Settings-14be7d23a2ee023796126453bba55f4bc84ba065.zip
packages_apps_Settings-14be7d23a2ee023796126453bba55f4bc84ba065.tar.gz
packages_apps_Settings-14be7d23a2ee023796126453bba55f4bc84ba065.tar.bz2
Fix bug #17208479 Have Cellular Networks Show up in Data Usage
- prevent collisions in the DocId (which is the primary key of the FTS4 table) - instead of just using "updatedTitle" hash, use instead "updatedTitle + screenTitle" Change-Id: If38f7bcc7fb857d59242d08c16c39adb80590254
Diffstat (limited to 'src/com/android/settings/search')
-rw-r--r--src/com/android/settings/search/Index.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/settings/search/Index.java b/src/com/android/settings/search/Index.java
index f5a2fa9..db60dfe 100644
--- a/src/com/android/settings/search/Index.java
+++ b/src/com/android/settings/search/Index.java
@@ -1025,8 +1025,14 @@ public class Index {
return;
}
+ // 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 the title and the screenTitle.
+ StringBuilder sb = new StringBuilder(updatedTitle);
+ sb.append(screenTitle);
+ int docId = sb.toString().hashCode();
+
ContentValues values = new ContentValues();
- values.put(IndexColumns.DOCID, updatedTitle.hashCode());
+ values.put(IndexColumns.DOCID, docId);
values.put(IndexColumns.LOCALE, locale);
values.put(IndexColumns.DATA_RANK, rank);
values.put(IndexColumns.DATA_TITLE, updatedTitle);