From 8b818ea568ee553bc795ed89fdb473b9bfdd0866 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 9 Dec 2010 12:50:05 -0800 Subject: [PATCH] Delete attachment files when wiping Email data Bug: 3276145 Change-Id: I8fd48a7b2c312929e9a4caf3682dadd610c997e9 --- src/com/android/exchange/adapter/EmailSyncAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/exchange/adapter/EmailSyncAdapter.java b/src/com/android/exchange/adapter/EmailSyncAdapter.java index 5635af20e..b005bcb29 100644 --- a/src/com/android/exchange/adapter/EmailSyncAdapter.java +++ b/src/com/android/exchange/adapter/EmailSyncAdapter.java @@ -28,6 +28,7 @@ import com.android.email.mail.internet.MimeMessage; import com.android.email.mail.internet.MimeUtility; import com.android.email.provider.AttachmentProvider; import com.android.email.provider.EmailContent; +import com.android.email.provider.EmailProvider; import com.android.email.provider.EmailContent.Account; import com.android.email.provider.EmailContent.AccountColumns; import com.android.email.provider.EmailContent.Attachment; @@ -36,7 +37,6 @@ import com.android.email.provider.EmailContent.Mailbox; import com.android.email.provider.EmailContent.Message; import com.android.email.provider.EmailContent.MessageColumns; import com.android.email.provider.EmailContent.SyncColumns; -import com.android.email.provider.EmailProvider; import com.android.email.service.MailService; import com.android.exchange.Eas; import com.android.exchange.EasSyncService; @@ -114,6 +114,8 @@ public class EmailSyncAdapter extends AbstractSyncAdapter { Message.MAILBOX_KEY + "=" + mMailbox.mId, null); mContentResolver.delete(Message.UPDATED_CONTENT_URI, Message.MAILBOX_KEY + "=" + mMailbox.mId, null); + // Delete attachments... + AttachmentProvider.deleteAllMailboxAttachmentFiles(mContext, mAccount.mId, mMailbox.mId); } private String getEmailFilter() {