Home | History | Annotate | Download | only in provider

Lines Matching refs:Mailbox

29 import com.android.emailcommon.provider.Mailbox;
34 Mailbox.PARENT_KEY_UNINITIALIZED + ")";
35 // The flag we use in Account to indicate a mailbox change in progress
39 * Recalculate a mailbox's flags and the parent key of any children
41 * @param parentCursor a cursor to a mailbox that requires fixup
49 long parentId = parentCursor.getLong(Mailbox.CONTENT_ID_COLUMN);
51 int parentType = parentCursor.getInt(Mailbox.CONTENT_TYPE_COLUMN);
52 String parentServerId = parentCursor.getString(Mailbox.CONTENT_SERVER_ID_COLUMN);
54 if (parentType <= Mailbox.TYPE_NOT_EMAIL) {
55 parentFlags |= Mailbox.FLAG_HOLDS_MAIL + Mailbox.FLAG_SUPPORTS_SETTINGS;
58 if (parentType == Mailbox.TYPE_MAIL || parentType == Mailbox.TYPE_TRASH ||
59 parentType == Mailbox.TYPE_JUNK || parentType == Mailbox.TYPE_INBOX) {
60 parentFlags |= Mailbox.FLAG_ACCEPTS_MOVED_MAIL;
64 // An example of a mailbox with a null serverId would be an Outbox that we create locally
68 Cursor childCursor = resolver.query(Mailbox.CONTENT_URI,
69 Mailbox.ID_PROJECTION, MailboxColumns.PARENT_SERVER_ID + "=? AND " +
74 parentFlags |= Mailbox.FLAG_HAS_CHILDREN | Mailbox.FLAG_CHILDREN_VISIBLE;
76 childValues.put(Mailbox.PARENT_KEY, parentId);
77 long childId = childCursor.getLong(Mailbox.ID_PROJECTION_COLUMN);
78 resolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, childId),
85 // Mark this is having no parent, so that we don't examine this mailbox again
86 parentValues.put(Mailbox.PARENT_KEY, Mailbox.NO_MAILBOX);
87 Log.w(Logging.LOG_TAG, "Mailbox with null serverId: " +
88 parentCursor.getString(Mailbox.CONTENT_DISPLAY_NAME_COLUMN) + ", type: " +
92 parentValues.put(Mailbox.FLAGS, parentFlags);
93 resolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, parentId),
98 * Recalculate a mailbox's flags and the parent key of any children
101 * @param serverId the server id of an individual mailbox
105 Cursor cursor = context.getContentResolver().query(Mailbox.CONTENT_URI,
106 Mailbox.CONTENT_PROJECTION, MailboxColumns.SERVER_ID + "=? AND " + accountSelector,
120 * and flags for each mailbox in the account(s) that is uninitialized (parentKey = 0 or null)
134 resolver.query(Mailbox.CONTENT_URI, Mailbox.CONTENT_PROJECTION,
141 noParentKeyMailboxCursor.getString(Mailbox.CONTENT_PARENT_SERVER_ID_COLUMN);
154 values.put(Mailbox.PARENT_KEY, Mailbox.NO_MAILBOX);
155 resolver.update(Mailbox.CONTENT_URI, values, noParentKeySelection, null);
161 // Set temporary flag indicating state of update of mailbox list
170 * Indicate that the specified account is starting the process of changing its mailbox list
172 * @param accountId the account that is starting to change its mailbox list
179 * Indicate that the specified account is ending the process of changing its mailbox list
181 * @param accountId the account that is finished with changes to its mailbox list
200 " has inconsistent mailbox data; fixing up...");
203 values.put(Mailbox.PARENT_KEY, Mailbox.PARENT_KEY_UNINITIALIZED);
204 String accountSelector = Mailbox.ACCOUNT_KEY + "=" + account.mId;
206 resolver.update(Mailbox.CONTENT_URI, values, accountSelector, null);