diff options
Diffstat (limited to 'src/com/android/providers/contacts/ContactsProvider2.java')
-rw-r--r-- | src/com/android/providers/contacts/ContactsProvider2.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java index 02e9c52..80f7c5b 100644 --- a/src/com/android/providers/contacts/ContactsProvider2.java +++ b/src/com/android/providers/contacts/ContactsProvider2.java @@ -3739,17 +3739,20 @@ public class ContactsProvider2 extends AbstractContactsProvider // because it's in a trigger. Consider removing trigger and replacing with java code. // This has to happen before the raw contact is deleted since it relies on the number // of raw contacts. - ContactsTableUtil.deleteContactIfSingleton(db, rawContactId); + if (ContactsTableUtil.deleteContactIfSingleton(db, rawContactId) == 0) { + mAggregator.get().updateAggregateData(mTransactionContext.get(), contactId); + } db.delete(Tables.PRESENCE, PresenceColumns.RAW_CONTACT_ID + "=" + rawContactId, null); int count = db.delete(Tables.RAW_CONTACTS, RawContacts._ID + "=" + rawContactId, null); - mAggregator.get().updateAggregateData(mTransactionContext.get(), contactId); mTransactionContext.get().markRawContactChangedOrDeletedOrInserted(rawContactId); return count; } - ContactsTableUtil.deleteContactIfSingleton(db, rawContactId); + if (ContactsTableUtil.deleteContactIfSingleton(db, rawContactId) == 0) { + mAggregator.get().updateAggregateData(mTransactionContext.get(), contactId); + } return markRawContactAsDeleted(db, rawContactId, callerIsSyncAdapter); } |