diff options
author | Brian Attwell <brianattwell@google.com> | 2015-01-28 12:12:10 -0800 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2015-01-28 12:16:04 -0800 |
commit | c44ee526c56d2f5e680cef24897cff3a922d6a2f (patch) | |
tree | 7f60ffd6681ad1180e77205ff35236eaeee1ec7a /src/com/android | |
parent | 75b452b88ad2841415a48e95706f538428ec200a (diff) | |
download | packages_providers_ContactsProvider-c44ee526c56d2f5e680cef24897cff3a922d6a2f.zip packages_providers_ContactsProvider-c44ee526c56d2f5e680cef24897cff3a922d6a2f.tar.gz packages_providers_ContactsProvider-c44ee526c56d2f5e680cef24897cff3a922d6a2f.tar.bz2 |
Additional change to IS_SUPER_PRIMARY
Noticed clearSuperPrimarySetting() sometimes clears all
mimetypes's is_super_primary flag values sometimes, even
mimetypes that aren't contained in both raw contacts.
This doesn't appear to have been the intended behavior.
Looks like a simple bug. Wrote a unit test and fixed
the bug. Added a new method to DataUtil used inside the
unit test. This method wasn't strictly necessary. But
it is very useful in later CLs.
(Part #2 or "Remove NAME_VERIFIED" series of CLs)
Bug: 5080996
Bug: 18777272
Change-Id: I354ffe51ea64cc532387d7ba79fbb6d2389d662e
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/providers/contacts/aggregation/ContactAggregator.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/com/android/providers/contacts/aggregation/ContactAggregator.java b/src/com/android/providers/contacts/aggregation/ContactAggregator.java index ab87c7e..5c7858e 100644 --- a/src/com/android/providers/contacts/aggregation/ContactAggregator.java +++ b/src/com/android/providers/contacts/aggregation/ContactAggregator.java @@ -940,11 +940,8 @@ public class ContactAggregator { " WHERE " + RawContacts.CONTACT_ID + "=?1)" + " OR " + Data.RAW_CONTACT_ID + "=?2)"; - if (index > 0) { - mimeTypeCondition.append(')'); - superPrimaryUpdateSql += mimeTypeCondition.toString(); - } - + mimeTypeCondition.append(')'); + superPrimaryUpdateSql += mimeTypeCondition.toString(); db.execSQL(superPrimaryUpdateSql, args); } |