From 469d07fdd4bed7d565c9c6e43b2623f63406d391 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 31 Aug 2009 21:43:54 -0700 Subject: [PATCH] Use bulk delete for wiping contacts, now that it's implemented in ContactsProvider Change-Id: I0363901902cc8c17116222eb78bacd2e96ad28d7 --- .../exchange/adapter/ContactsSyncAdapter.java | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/com/android/exchange/adapter/ContactsSyncAdapter.java b/src/com/android/exchange/adapter/ContactsSyncAdapter.java index 65803d973..400607a35 100644 --- a/src/com/android/exchange/adapter/ContactsSyncAdapter.java +++ b/src/com/android/exchange/adapter/ContactsSyncAdapter.java @@ -262,23 +262,9 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter { @Override public void wipe() { - // TODO Use the bulk delete when the CP supports it -// mContentResolver.delete(mAccountUri.buildUpon() -// .appendQueryParameter(ContactsContract.RawContacts.DELETE_PERMANENTLY, "true") -// .build(), null, null); - Cursor c = mContentResolver.query(mAccountUri, new String[] {"_id"}, null, null, null); - try { - while (c.moveToNext()) { - long id = c.getLong(0); - mContentResolver.delete(ContentUris - .withAppendedId(mAccountUri, id) - .buildUpon().appendQueryParameter( - ContactsContract.RawContacts.DELETE_PERMANENTLY, "true") - .build(), null, null); - } - } finally { - c.close(); - } + mContentResolver.delete(mAccountUri.buildUpon() + .appendQueryParameter(ContactsContract.RawContacts.DELETE_PERMANENTLY, "true") + .build(), null, null); } public void addData(String serverId, ContactOperations ops, Entity entity)