From eb4ee8a7aa540e77c57af1635ede7f89124f1259 Mon Sep 17 00:00:00 2001 From: Yu Ping Hu Date: Thu, 1 Aug 2013 16:19:28 -0700 Subject: Move required system folder types to Mailbox. I'm formalizing the concept of folders that must exist, and the list of such folders should be accessible to all sync adapters. Change-Id: I9e4d2d51aa495d211eab2d1e36c3fa197a1ac00d --- src/com/android/email/service/EmailServiceStub.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src') diff --git a/src/com/android/email/service/EmailServiceStub.java b/src/com/android/email/service/EmailServiceStub.java index aef1d8399..6752d8a78 100644 --- a/src/com/android/email/service/EmailServiceStub.java +++ b/src/com/android/email/service/EmailServiceStub.java @@ -79,15 +79,6 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm private static final int MAILBOX_COLUMN_SERVER_ID = 1; private static final int MAILBOX_COLUMN_TYPE = 2; - /** System folders that should always exist. */ - private final int[] DEFAULT_FOLDERS = { - Mailbox.TYPE_INBOX, - Mailbox.TYPE_DRAFTS, - Mailbox.TYPE_OUTBOX, - Mailbox.TYPE_SENT, - Mailbox.TYPE_TRASH - }; - /** Small projection for just the columns required for a sync. */ private static final String[] MAILBOX_PROJECTION = new String[] { MailboxColumns.ID, @@ -351,7 +342,7 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm Cursor localFolderCursor = null; try { // Step 0: Make sure the default system mailboxes exist. - for (int type : DEFAULT_FOLDERS) { + for (final int type : Mailbox.REQUIRED_FOLDER_TYPES) { if (Mailbox.findMailboxOfType(mContext, accountId, type) == Mailbox.NO_MAILBOX) { Mailbox mailbox = Mailbox.newSystemMailbox(mContext, accountId, type); mailbox.save(mContext); -- cgit v1.2.3