Merge "Delete calendar properly on commanded wipe" into honeycomb

This commit is contained in:
Marc Blank 2011-02-01 06:50:08 -08:00 committed by Android (Google) Code Review
commit 73ba71506a

View File

@ -38,6 +38,7 @@ import android.content.Entity.NamedContentValues;
import android.content.EntityIterator; import android.content.EntityIterator;
import android.content.OperationApplicationException; import android.content.OperationApplicationException;
import android.database.Cursor; import android.database.Cursor;
import android.database.DatabaseUtils;
import android.net.Uri; import android.net.Uri;
import android.os.RemoteException; import android.os.RemoteException;
import android.provider.Calendar; import android.provider.Calendar;
@ -192,8 +193,11 @@ public class CalendarSyncAdapter extends AbstractSyncAdapter {
@Override @Override
public void wipe() { public void wipe() {
// Delete the calendar associated with this account // Delete the calendar associated with this account
mContentResolver.delete(Calendars.CONTENT_URI, CALENDAR_SELECTION, // CalendarProvider2 does NOT handle selection arguments in deletions
new String[] {mEmailAddress, Email.EXCHANGE_ACCOUNT_MANAGER_TYPE}); mContentResolver.delete(Calendars.CONTENT_URI, Calendars._SYNC_ACCOUNT +
"=" + DatabaseUtils.sqlEscapeString(mEmailAddress) + " AND " +
Calendars._SYNC_ACCOUNT_TYPE + "=" +
DatabaseUtils.sqlEscapeString(Email.EXCHANGE_ACCOUNT_MANAGER_TYPE), null);
} }
@Override @Override