Lines Matching defs:mailbox
50 import com.android.emailcommon.provider.Mailbox;
95 MailboxColumns.TYPE + "=" + Mailbox.TYPE_ATTACHMENT;
112 Mailbox.TYPE_EAS_ACCOUNT_MAILBOX;
207 * Delete all Messages that live in the attachment mailbox
210 // Note: There should only be one attachment mailbox at present
214 c = resolver.query(Mailbox.CONTENT_URI, EmailContent.ID_PROJECTION,
232 * Get a mailbox based on a sqlite WHERE clause
234 private Mailbox getGlobalMailboxWhere(String where) {
235 Cursor c = mProviderContext.getContentResolver().query(Mailbox.CONTENT_URI,
236 Mailbox.CONTENT_PROJECTION, where, null, null);
239 Mailbox m = new Mailbox();
250 * Returns the attachment mailbox (where we store eml attachment Emails), creating one
252 * @return the global attachment mailbox
254 public Mailbox getAttachmentMailbox() {
255 Mailbox m = getGlobalMailboxWhere(WHERE_TYPE_ATTACHMENT);
257 m = new Mailbox();
262 m.mSyncInterval = Mailbox.CHECK_INTERVAL_NEVER;
263 m.mType = Mailbox.TYPE_ATTACHMENT;
270 * Returns the search mailbox for the specified account, creating one if necessary
271 * @return the search mailbox for the passed in account
273 public Mailbox getSearchMailbox(long accountId) {
274 Mailbox m = Mailbox.restoreMailboxOfType(mContext, accountId, Mailbox.TYPE_SEARCH);
276 m = new Mailbox();
281 m.mSyncInterval = Mailbox.CHECK_INTERVAL_NEVER;
282 m.mType = Mailbox.TYPE_SEARCH;
283 m.mFlags = Mailbox.FLAG_HOLDS_MAIL;
284 m.mParentKey = Mailbox.NO_MAILBOX;
291 * Create a Message from the Uri and store it in the attachment mailbox
296 Mailbox mailbox = getAttachmentMailbox();
297 if (mailbox == null) return null;
307 LegacyConversions.updateMessageFields(msg, pop3Message, 0, mailbox.mId);
365 * Request a remote update of a mailbox. For use by the timed service.
395 * Request a remote update of a mailbox.
399 * downloading some/all of the messages in this mailbox, but that should be interruptable.
419 Mailbox mailbox =
420 Mailbox.restoreMailboxWithId(mProviderContext, mailboxId);
421 if (account == null || mailbox == null ||
422 mailbox.mType == Mailbox.TYPE_SEARCH) {
425 mLegacyController.synchronizeMailbox(account, mailbox, mLegacyListener);
471 * Saves the message to a mailbox of given type.
475 * @param mailboxType the mailbox type (e.g. Mailbox.TYPE_DRAFTS).
485 * Look for a specific system mailbox, creating it if necessary, and return the mailbox id.
491 * @param mailboxType the mailbox type (e.g. EmailContent.Mailbox.TYPE_TRASH)
492 * @return the id of the mailbox. The mailbox is created if not existing.
493 * Returns Mailbox.NO_MAILBOX if the accountId or mailboxType are negative.
498 return Mailbox.NO_MAILBOX;
501 Mailbox.findMailboxOfType(mProviderContext, accountId, mailboxType);
502 return mailboxId == Mailbox.NO_MAILBOX ? createMailbox(accountId, mailboxType) : mailboxId;
506 * Returns the server-side name for a specific mailbox.
508 * @return the resource string corresponding to the mailbox type, empty if not found.
513 case Mailbox.TYPE_INBOX:
516 case Mailbox.TYPE_OUTBOX:
519 case Mailbox.TYPE_DRAFTS:
522 case Mailbox.TYPE_TRASH:
525 case Mailbox.TYPE_SENT:
528 case Mailbox.TYPE_JUNK:
536 * Create a mailbox given the account and mailboxType.
546 Mailbox box = Mailbox.newSystemMailbox(
577 long outboxId = findOrCreateMailboxOfType(accountId, Mailbox.TYPE_OUTBOX);
603 final long sentboxId = findOrCreateMailboxOfType(accountId, Mailbox.TYPE_SENT);
619 Mailbox.findMailboxOfType(mProviderContext, accountId, Mailbox.TYPE_OUTBOX);
620 if (outboxId == Mailbox.NO_MAILBOX) {
663 resolver.update(Mailbox.CONTENT_URI, cv,
678 * Increase the load count for a given mailbox, and trigger a refresh. Applies only to
679 * IMAP and POP mailboxes, with the exception of the EAS search mailbox.
681 * @param mailboxId the mailbox
686 Mailbox mailbox = Mailbox.restoreMailboxWithId(mProviderContext, mailboxId);
687 if (mailbox == null) {
690 if (mailbox.mType == Mailbox.TYPE_SEARCH) {
692 searchMore(mailbox.mAccountKey);
699 mailbox.mAccountKey);
707 Uri uri = ContentUris.withAppendedId(Mailbox.ADD_TO_FIELD_URI, mailboxId);
710 mailbox.mVisibleLimit += Email.VISIBLE_LIMIT_INCREMENT;
711 mLegacyController.synchronizeMailbox(account, mailbox, mLegacyListener);
786 // 2. Confirm that there is a trash mailbox available. If not, create one
787 long trashMailboxId = findOrCreateMailboxOfType(account.mId, Mailbox.TYPE_TRASH);
789 // 3. Get the message's original mailbox
790 Mailbox mailbox = Mailbox.getMailboxForMessageId(mProviderContext, messageId);
792 if (mailbox == null) return;
803 if ((mailbox.mId == trashMailboxId) || (mailbox.mType == Mailbox.TYPE_DRAFTS)) {
819 * Moves messages to a new mailbox.
824 * Note this method assumes all of the given message and mailbox IDs belong to the same
828 * @param newMailboxId ID of the new mailbox that the messages will be moved to
980 // Find/create our search mailbox
981 Mailbox searchMailbox = getSearchMailbox(accountId);
988 // Delete existing contents of search mailbox
993 // For now, use the actual query as the name of the mailbox
994 cv.put(Mailbox.DISPLAY_NAME, searchParams.mFilter);
995 resolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, searchMailboxId),
1011 // This is the actual mailbox we'll be searching
1012 Mailbox actualMailbox = Mailbox.restoreMailboxWithId(mContext, searchParams.mMailboxId);
1014 Log.e(Logging.LOG_TAG, "Unable to find mailbox " + searchParams.mMailboxId
1182 * The only mailbox not deleted is the account mailbox (if any)
1200 resolver.delete(Mailbox.CONTENT_URI,
1210 cv.putNull(Mailbox.SYNC_KEY);
1211 resolver.update(Mailbox.CONTENT_URI, cv,
1257 * @param mailboxId The mailbox being operated on
1295 * @param mailboxId The mailbox being operated on (may be unknown at start)
1675 Mailbox mbx = Mailbox.restoreMailboxWithId(mProviderContext, mailboxId);
1676 // The mailbox could have disappeared if the server commanded it