Use bulk delete for wiping contacts, now that it's implemented in ContactsProvider
Change-Id: I0363901902cc8c17116222eb78bacd2e96ad28d7
This commit is contained in:
parent
b3e4c79873
commit
469d07fdd4
@ -262,23 +262,9 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void wipe() {
|
public void wipe() {
|
||||||
// TODO Use the bulk delete when the CP supports it
|
mContentResolver.delete(mAccountUri.buildUpon()
|
||||||
// mContentResolver.delete(mAccountUri.buildUpon()
|
.appendQueryParameter(ContactsContract.RawContacts.DELETE_PERMANENTLY, "true")
|
||||||
// .appendQueryParameter(ContactsContract.RawContacts.DELETE_PERMANENTLY, "true")
|
.build(), null, null);
|
||||||
// .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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addData(String serverId, ContactOperations ops, Entity entity)
|
public void addData(String serverId, ContactOperations ops, Entity entity)
|
||||||
|
Loading…
Reference in New Issue
Block a user