diff options
author | Makoto Onuki <omakoto@google.com> | 2014-07-24 18:17:57 -0700 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2014-07-28 11:40:49 -0700 |
commit | 8a8ddc3d1ceee9872ace06326ebe999ba171f70b (patch) | |
tree | 423d43eb8cf510465085af32e5d14cb2d27928ec /src/com/android/providers/contacts/ContactsDatabaseHelper.java | |
parent | 0fc2f46b80df2c4c14bec40055eb6b954c0c6523 (diff) | |
download | packages_providers_ContactsProvider-8a8ddc3d1ceee9872ace06326ebe999ba171f70b.zip packages_providers_ContactsProvider-8a8ddc3d1ceee9872ace06326ebe999ba171f70b.tar.gz packages_providers_ContactsProvider-8a8ddc3d1ceee9872ace06326ebe999ba171f70b.tar.bz2 |
Do not build NAME_LOOKUP from phonetic names
This prevents aggregation by phonetic name
Note: if a contact only has a phonetic name (i.e. without any non-phonetic name components), then
its display name is set from the phonetic name. This CL does *not* prevent phonetic-name-based
display names getting into NAME_LOOKUP, meaning if two contacts have no names but the same phonetic
name, then they *will* still be aggregated. But this shouldn't be an issue since what was an issue
was "aggregating two contacts with *different* names with the same phonetic name".
Bug 10957673
Change-Id: I6484128b1f7e4bbe1b08c57969a8a1ef147d5c7d
Diffstat (limited to 'src/com/android/providers/contacts/ContactsDatabaseHelper.java')
-rw-r--r-- | src/com/android/providers/contacts/ContactsDatabaseHelper.java | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java index bda9826..f23d245 100644 --- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java +++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java @@ -116,7 +116,7 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { * 900-999 L * </pre> */ - static final int DATABASE_VERSION = 906; + static final int DATABASE_VERSION = 907; public interface Tables { public static final String CONTACTS = "contacts"; @@ -2776,6 +2776,12 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { oldVersion = 906; } + if (oldVersion < 907) { + // Rebuild NAME_LOOKUP. + upgradeNameLookup = true; + oldVersion = 907; + } + if (upgradeViewsAndTriggers) { createContactsViews(db); createGroupsView(db); @@ -5653,25 +5659,6 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { } } - public void insertNameLookupForPhoneticName(long rawContactId, long dataId, String familyName, - String middleName, String givenName) { - mSb.setLength(0); - if (familyName != null) { - mSb.append(familyName.trim()); - } - if (middleName != null) { - mSb.append(middleName.trim()); - } - if (givenName != null) { - mSb.append(givenName.trim()); - } - - if (mSb.length() > 0) { - insertNameLookup(rawContactId, dataId, NameLookupType.NAME_COLLATION_KEY, - NameNormalizer.normalize(mSb.toString())); - } - } - /** * Performs a query and returns true if any Data item of the raw contact with the given * id and mimetype is marked as super-primary |