Lines Matching refs:Mailbox
37 import com.android.emailcommon.provider.Mailbox;
66 * Mapping from EAS type values to {@link Mailbox} types.
69 * If an EAS type is not in the map, or is inserted with a value of {@link Mailbox#TYPE_NONE},
71 * TODO: Maybe we should store the mailbox anyway, otherwise it'll be annoying to upgrade.
76 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_USER_GENERIC, Mailbox.TYPE_MAIL);
77 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_INBOX, Mailbox.TYPE_INBOX);
78 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_DRAFTS, Mailbox.TYPE_DRAFTS);
79 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_DELETED, Mailbox.TYPE_TRASH);
80 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_SENT, Mailbox.TYPE_SENT);
81 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_OUTBOX, Mailbox.TYPE_OUTBOX);
82 //MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_TASKS, Mailbox.TYPE_TASKS);
83 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_CALENDAR, Mailbox.TYPE_CALENDAR);
84 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_CONTACTS, Mailbox.TYPE_CONTACTS);
85 //MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_NOTES, Mailbox.TYPE_NONE);
86 //MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_JOURNAL, Mailbox.TYPE_NONE);
87 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_USER_MAIL, Mailbox.TYPE_MAIL);
88 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_USER_CALENDAR, Mailbox.TYPE_CALENDAR);
89 MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_USER_CONTACTS, Mailbox.TYPE_CONTACTS);
90 //MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_USER_TASKS, Mailbox.TYPE_TASKS);
91 //MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_USER_JOURNAL, Mailbox.TYPE_NONE);
92 //MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_USER_NOTES, Mailbox.TYPE_NONE);
93 //MAILBOX_TYPE_MAP.put(Eas.MAILBOX_TYPE_UNKNOWN, Mailbox.TYPE_NONE);
94 //MAILBOX_TYPE_MAP.put(MAILBOX_TYPE_RECIPIENT_INFORMATION_CACHE, Mailbox.TYPE_NONE);
101 * Content selection to find a specific mailbox by server id. Since server ids aren't unique
108 * Content selection to find a specific mailbox by display name and account.
120 /** Projection used when fetching a Mailbox's ids. */
138 /** Flags that are set or cleared when a mailbox's child status changes. */
140 Mailbox.FLAG_HAS_CHILDREN | Mailbox.FLAG_CHILDREN_VISIBLE;
142 /** Mailbox.NO_MAILBOX, as a string (convenience since this is used in several places). */
143 private static final String NO_MAILBOX_STRING = Long.toString(Mailbox.NO_MAILBOX);
168 new SparseBooleanArray(Mailbox.REQUIRED_FOLDER_TYPES.length);
173 UNINITIALIZED_PARENT_KEY.put(MailboxColumns.PARENT_KEY, Mailbox.PARENT_KEY_UNINITIALIZED);
205 mContentResolver.delete(Mailbox.CONTENT_URI, WHERE_ACCOUNT_KEY,
275 return mContentResolver.query(Mailbox.CONTENT_URI, MAILBOX_ID_COLUMNS_PROJECTION,
289 // Find the mailbox in this account with the given serverId
296 ContentUris.withAppendedId(Mailbox.CONTENT_URI,
328 Account.CHECK_INTERVAL_NEVER + " OR " + Mailbox.SYNC_LOOKBACK + "!=" +
340 * For every mailbox in this account that has a non-default interval or lookback, save those
347 Cursor c = mContentResolver.query(Mailbox.CONTENT_URI, MAILBOX_STATE_PROJECTION,
363 * For every set of saved mailbox sync options, try to find and restore those values
376 mContentResolver.update(Mailbox.CONTENT_URI, cv, WHERE_SERVER_ID_AND_ACCOUNT,
385 * Add a {@link ContentProviderOperation} to {@link #mOperations} to add a mailbox.
386 * @param name The new mailbox's name.
387 * @param serverId The new mailbox's server id.
388 * @param parentServerId The server id of the new mailbox's parent ("0" if none).
389 * @param mailboxType The mailbox's type, which is one of the values defined in {@link Mailbox}.
390 * @param fromServer Whether this mailbox was synced from server (as opposed to local-only).
403 cv.put(MailboxColumns.PARENT_KEY, Mailbox.NO_MAILBOX);
411 cv.put(MailboxColumns.PARENT_KEY, Mailbox.NO_MAILBOX);
418 final boolean shouldSync = fromServer && Mailbox.getDefaultSyncStateForType(mailboxType);
423 if (mailboxType <= Mailbox.TYPE_NOT_EMAIL) {
424 flags |= Mailbox.FLAG_HOLDS_MAIL + Mailbox.FLAG_SUPPORTS_SETTINGS;
427 if (mailboxType == Mailbox.TYPE_MAIL || mailboxType == Mailbox.TYPE_TRASH ||
428 mailboxType == Mailbox.TYPE_JUNK || mailboxType == Mailbox.TYPE_INBOX) {
429 flags |= Mailbox.FLAG_ACCEPTS_MOVED_MAIL;
434 cv.put(MailboxColumns.FLAG_VISIBLE, (mailboxType < Mailbox.TYPE_NOT_EMAIL));
437 ContentProviderOperation.newInsert(Mailbox.CONTENT_URI).withValues(cv).build());
476 final int mailboxType = MAILBOX_TYPE_MAP.get(type, Mailbox.TYPE_NONE);
477 if (mailboxType != Mailbox.TYPE_NONE) {
516 // If we find the mailbox (using serverId), make the change
521 cv.put(Mailbox.PARENT_SERVER_ID, parentId);
526 cv.put(Mailbox.PARENT_KEY, Mailbox.NO_MAILBOX);
534 cv.put(Mailbox.DISPLAY_NAME, displayName);
537 ContentUris.withAppendedId(Mailbox.CONTENT_URI,
639 final Cursor parentCursor = mContentResolver.query(Mailbox.CONTENT_URI,
660 final Cursor childCursor = mContentResolver.query(Mailbox.CONTENT_URI,
673 ContentUris.withAppendedId(Mailbox.CONTENT_URI, childId)).
694 Mailbox.CONTENT_URI, parentId)).withValues(cv).build());
716 for (final int requiredType : Mailbox.REQUIRED_FOLDER_TYPES) {
718 addMailboxOp(Mailbox.getSystemMailboxName(mContext, requiredType),
734 Cursor c = mContentResolver.query(Mailbox.CONTENT_URI,
748 mContentResolver.delete(ContentUris.withAppendedId(Mailbox.CONTENT_URI, id),
751 mContentResolver.delete(Mailbox.CONTENT_URI, WHERE_PARENT_SERVER_ID_AND_ACCOUNT,
772 // Save away any mailbox sync information that is NOT default
775 mContentResolver.delete(Mailbox.CONTENT_URI, WHERE_ACCOUNT_KEY,