* A provider that implements this command should include this key in its response with a * value of {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. */ public static final String COMMAND_KEY_SET_VISIBILITY = "setVisibility"; /** * This key has a boolean value: true to indicate that this folder list is shown to the user * either on first call (launcher/widget/notification) or after switching from an existing * folder: Inbox -> Folder. Repeated calls are sent when switching back to the folder. Inbox * -> Folder -> Spam -> Folder will generate two calls to respond() with the value true for * "Folder". *
* A provider that implements this command should include the * {@link #COMMAND_KEY_SET_VISIBILITY} key in its response with a value of * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. This is always * set with {@link #COMMAND_KEY_SET_VISIBILITY} because this is only set when the folder * list is made visible. */ public static final String COMMAND_KEY_ENTERED_FOLDER = "enteredFolder"; /** * This key has an int value, indicating the position that the UI wants to notify the * provider that the data from a specified row is being shown to the user. *
* A provider that implements this command should include the * {@link #COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE} key in its response with a value of * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. */ public static final String COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE = "uiPositionChange"; /** * Rather than jamming a {@link ConversationInfo} into a byte-array blob to be read out of * a cursor, providers can optionally implement this command to directly return the object * in a Bundle. *
* The requestor (UI code) will place a meaningless value in the request Bundle. The UI will * also move the cursor position to the desired place prior to calling respond(). Providers * should just use {@link Bundle#containsKey(String)} to check for this kind of request and * generate an object at the current cursor position. *
* A provider that implements this command should include the * {@link #COMMAND_GET_CONVERSATION_INFO} key in its response with a * {@link ConversationInfo} Parcelable object as its value. */ public static final String COMMAND_GET_CONVERSATION_INFO = ConversationColumns.CONVERSATION_INFO; /** * Rather than jamming a {@link FolderList} into a byte-array blob to be read out of * a cursor, providers can optionally implement this command to directly return the object * in a Bundle. *
* The requestor (UI code) will place a meaningless value in the request Bundle. The UI will * also move the cursor position to the desired place prior to calling respond(). Providers * should just use {@link Bundle#containsKey(String)} to check for this kind of request and * generate an object at the current cursor position. *
* A provider that implements this command should include the * {@link #COMMAND_GET_RAW_FOLDERS} key in its response with a * {@link FolderList} Parcelable object as its value. */ public static final String COMMAND_GET_RAW_FOLDERS = ConversationColumns.RAW_FOLDERS; private ConversationCursorCommand() {} } /** * List of operations that can can be performed on a conversation. These operations are applied * with {@link ContentProvider#update(Uri, ContentValues, String, String[])} * where the conversation uri is specified, and the ContentValues specifies the operation to * be performed. *
* The operation to be performed is specified in the ContentValues by * the {@link ConversationOperations#OPERATION_KEY} * * Note not all UI providers will support these operations. {@link AccountCapabilities} can * be used to determine which operations are supported. */ public static final class ConversationOperations { /** * ContentValues key used to specify the operation to be performed */ public static final String OPERATION_KEY = "operation"; /** * Archive operation */ public static final String ARCHIVE = "archive"; /** * Mute operation */ public static final String MUTE = "mute"; /** * Report spam operation */ public static final String REPORT_SPAM = "report_spam"; /** * Report not spam operation */ public static final String REPORT_NOT_SPAM = "report_not_spam"; /** * Report phishing operation */ public static final String REPORT_PHISHING = "report_phishing"; /** * Discard drafts operation */ public static final String DISCARD_DRAFTS = "discard_drafts"; /** * Update conversation folder(s) operation. ContentValues passed as part * of this update will be of the format (FOLDERS_UPDATED, csv of updated * folders) where the comma separated values of the updated folders will * be of the format: folderuri/ADD_VALUE. ADD_VALUE will be true if the * folder was added, false if it was removed. */ public static final String FOLDERS_UPDATED = "folders_updated"; public static final String FOLDERS_UPDATED_SPLIT_PATTERN = ","; public static final class Parameters { /** * Boolean indicating whether the undo for this operation should be suppressed */ public static final String SUPPRESS_UNDO = "suppress_undo"; private Parameters() {} } private ConversationOperations() { } } /** * Methods that can be "called" using the account uri, through * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} * Note, the arg parmateter of call should be the account uri. */ public static final class AccountCallMethods { /** * Save message method. The Bundle for the call to * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the * columns specified in {@link MessageColumns}, and if this is a save for an existing * message, an entry for the {@link MessageColumns#URI} should reference the existing * message * * The Bundle returned will contain the message uri in the returned bundled with the * {@link MessageColumns#URI} key. */ public static final String SAVE_MESSAGE = "save_message"; /** * Send message method. The Bundle for the call to * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the * columns specified in {@link MessageColumns}, and if this is a send of an existing * message, an entry for the {@link MessageColumns#URI} should reference the existing * message * * The Bundle returned will contain the message uri in the returned bundled with the * {@link MessageColumns#URI} key. */ public static final String SEND_MESSAGE = "send_message"; /** * Change account method. The Bundle for the call to * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the * columns specified in {@link SetCurrentAccountColumns} * * The Bundle returned will be empty. */ public static final String SET_CURRENT_ACCOUNT = "set_current_account"; private AccountCallMethods() {} } /** * Keys used for parameters to {@link AccountCallMethods#SEND_MESSAGE} or * {@link AccountCallMethods#SAVE_MESSAGE} methods. */ public static final class SendOrSaveMethodParamKeys { /** * Bundle key used to store any opened file descriptors. * The keys of this Bundle are the contentUri for each attachment, and the * values are {@link android.os.ParcelFileDescriptor} objects. */ public static final String OPENED_FD_MAP = "opened_fds"; private SendOrSaveMethodParamKeys() {} } public static final class DraftType { public static final int NOT_A_DRAFT = 0; public static final int COMPOSE = 1; public static final int REPLY = 2; public static final int REPLY_ALL = 3; public static final int FORWARD = 4; private DraftType() {} } /** * Class for the enum values to determine whether this * string should be displayed as a high priority warning * or a low priority warning. The current design has * high priority warnings in red while low priority warnings * are grey. */ public static final class SpamWarningLevel { public static final int NO_WARNING = 0; public static final int LOW_WARNING = 1; public static final int HIGH_WARNING = 2; private SpamWarningLevel() {} } /** * Class for the enum values to determine which type * of link to show in the spam warning. */ public static final class SpamWarningLinkType { public static final int NO_LINK = 0; public static final int IGNORE_WARNING = 1; public static final int REPORT_PHISHING = 2; private SpamWarningLinkType() {} } public static final String[] MESSAGE_PROJECTION = { BaseColumns._ID, MessageColumns.SERVER_ID, MessageColumns.URI, MessageColumns.CONVERSATION_ID, MessageColumns.SUBJECT, MessageColumns.SNIPPET, MessageColumns.FROM, MessageColumns.TO, MessageColumns.CC, MessageColumns.BCC, MessageColumns.REPLY_TO, MessageColumns.DATE_RECEIVED_MS, MessageColumns.BODY_HTML, MessageColumns.BODY_TEXT, MessageColumns.EMBEDS_EXTERNAL_RESOURCES, MessageColumns.REF_MESSAGE_ID, MessageColumns.DRAFT_TYPE, MessageColumns.APPEND_REF_MESSAGE_CONTENT, MessageColumns.HAS_ATTACHMENTS, MessageColumns.ATTACHMENT_LIST_URI, MessageColumns.MESSAGE_FLAGS, MessageColumns.ALWAYS_SHOW_IMAGES, MessageColumns.READ, MessageColumns.SEEN, MessageColumns.STARRED, MessageColumns.QUOTE_START_POS, MessageColumns.ATTACHMENTS, MessageColumns.CUSTOM_FROM_ADDRESS, MessageColumns.MESSAGE_ACCOUNT_URI, MessageColumns.EVENT_INTENT_URI, MessageColumns.SPAM_WARNING_STRING, MessageColumns.SPAM_WARNING_LEVEL, MessageColumns.SPAM_WARNING_LINK_TYPE, MessageColumns.VIA_DOMAIN, MessageColumns.IS_SENDING }; /** Separates attachment info parts in strings in a message. */ @Deprecated public static final String MESSAGE_ATTACHMENT_INFO_SEPARATOR = "\n"; public static final String MESSAGE_LIST_TYPE = "vnd.android.cursor.dir/vnd.com.android.mail.message"; public static final String MESSAGE_TYPE = "vnd.android.cursor.item/vnd.com.android.mail.message"; public static final int MESSAGE_ID_COLUMN = 0; public static final int MESSAGE_SERVER_ID_COLUMN = 1; public static final int MESSAGE_URI_COLUMN = 2; public static final int MESSAGE_CONVERSATION_URI_COLUMN = 3; public static final int MESSAGE_SUBJECT_COLUMN = 4; public static final int MESSAGE_SNIPPET_COLUMN = 5; public static final int MESSAGE_FROM_COLUMN = 6; public static final int MESSAGE_TO_COLUMN = 7; public static final int MESSAGE_CC_COLUMN = 8; public static final int MESSAGE_BCC_COLUMN = 9; public static final int MESSAGE_REPLY_TO_COLUMN = 10; public static final int MESSAGE_DATE_RECEIVED_MS_COLUMN = 11; public static final int MESSAGE_BODY_HTML_COLUMN = 12; public static final int MESSAGE_BODY_TEXT_COLUMN = 13; public static final int MESSAGE_EMBEDS_EXTERNAL_RESOURCES_COLUMN = 14; public static final int MESSAGE_REF_MESSAGE_URI_COLUMN = 15; public static final int MESSAGE_DRAFT_TYPE_COLUMN = 16; public static final int MESSAGE_APPEND_REF_MESSAGE_CONTENT_COLUMN = 17; public static final int MESSAGE_HAS_ATTACHMENTS_COLUMN = 18; public static final int MESSAGE_ATTACHMENT_LIST_URI_COLUMN = 19; public static final int MESSAGE_FLAGS_COLUMN = 20; public static final int MESSAGE_ALWAYS_SHOW_IMAGES_COLUMN = 21; public static final int MESSAGE_READ_COLUMN = 22; public static final int MESSAGE_SEEN_COLUMN = 23; public static final int MESSAGE_STARRED_COLUMN = 24; public static final int QUOTED_TEXT_OFFSET_COLUMN = 25; public static final int MESSAGE_ATTACHMENTS_COLUMN = 26; public static final int MESSAGE_CUSTOM_FROM_ADDRESS_COLUMN = 27; public static final int MESSAGE_ACCOUNT_URI_COLUMN = 28; public static final int MESSAGE_EVENT_INTENT_COLUMN = 29; public static final int MESSAGE_SPAM_WARNING_STRING_ID_COLUMN = 30; public static final int MESSAGE_SPAM_WARNING_LEVEL_COLUMN = 31; public static final int MESSAGE_SPAM_WARNING_LINK_TYPE_COLUMN = 32; public static final int MESSAGE_VIA_DOMAIN_COLUMN = 33; public static final int MESSAGE_IS_SENDING_COLUMN = 34; public static final class CursorStatus { // The cursor is actively loading more data public static final int LOADING = 1 << 0; // The cursor is currently not loading more data, but more data may be available public static final int LOADED = 1 << 1; // An error occured while loading data public static final int ERROR = 1 << 2; // The cursor is loaded, and there will be no more data public static final int COMPLETE = 1 << 3; public static boolean isWaitingForResults(int cursorStatus) { return 0 != (cursorStatus & LOADING); } } public static final class CursorExtraKeys { /** * This integer column contains the staus of the message cursor. The value will be * one defined in {@link CursorStatus}. */ public static final String EXTRA_STATUS = "cursor_status"; /** * Used for finding the cause of an error. * TODO: define these values */ public static final String EXTRA_ERROR = "cursor_error"; /** * This integer column contains the total message count for this folder. */ public static final String EXTRA_TOTAL_COUNT = "cursor_total_count"; } public static final class AccountCursorExtraKeys { /** * This integer column contains the staus of the account cursor. The value will be * 1 if all accounts have been fully loaded or 0 if the account list hasn't been fully * initialized */ public static final String ACCOUNTS_LOADED = "accounts_loaded"; } public static final class MessageFlags { public static final int REPLIED = 1 << 2; public static final int FORWARDED = 1 << 3; public static final int CALENDAR_INVITE = 1 << 4; } public static final class MessageColumns { /** * This string column contains a content provider URI that points to this single message. */ public static final String URI = "messageUri"; /** * This string column contains a server-assigned ID for this message. */ public static final String SERVER_ID = "serverMessageId"; public static final String CONVERSATION_ID = "conversationId"; /** * This string column contains the subject of a message. */ public static final String SUBJECT = "subject"; /** * This string column contains a snippet of the message body. */ public static final String SNIPPET = "snippet"; /** * This string column contains the single email address (and optionally name) of the sender. */ public static final String FROM = "fromAddress"; /** * This string column contains a comma-delimited list of "To:" recipient email addresses. */ public static final String TO = "toAddresses"; /** * This string column contains a comma-delimited list of "CC:" recipient email addresses. */ public static final String CC = "ccAddresses"; /** * This string column contains a comma-delimited list of "BCC:" recipient email addresses. * This value will be null for incoming messages. */ public static final String BCC = "bccAddresses"; /** * This string column contains the single email address (and optionally name) of the * sender's reply-to address. */ public static final String REPLY_TO = "replyToAddress"; /** * This long column contains the timestamp (in millis) of receipt of the message. */ public static final String DATE_RECEIVED_MS = "dateReceivedMs"; /** * This string column contains the HTML form of the message body, if available. If not, * a provider must populate BODY_TEXT. */ public static final String BODY_HTML = "bodyHtml"; /** * This string column contains the plaintext form of the message body, if HTML is not * otherwise available. If HTML is available, this value should be left empty (null). */ public static final String BODY_TEXT = "bodyText"; public static final String EMBEDS_EXTERNAL_RESOURCES = "bodyEmbedsExternalResources"; /** * This string column contains an opaque string used by the sendMessage api. */ public static final String REF_MESSAGE_ID = "refMessageId"; /** * This integer column contains the type of this draft, or zero (0) if this message is not a * draft. See {@link DraftType} for possible values. */ public static final String DRAFT_TYPE = "draftType"; /** * This boolean column indicates whether an outgoing message should trigger special quoted * text processing upon send. The value should default to zero (0) for protocols that do * not support or require this flag, and for all incoming messages. */ public static final String APPEND_REF_MESSAGE_CONTENT = "appendRefMessageContent"; /** * This boolean column indicates whether a message has attachments. The list of attachments * can be retrieved using the URI in {@link MessageColumns#ATTACHMENT_LIST_URI}. */ public static final String HAS_ATTACHMENTS = "hasAttachments"; /** * This string column contains the content provider URI for the list of * attachments associated with this message. */ public static final String ATTACHMENT_LIST_URI = "attachmentListUri"; /** * This long column is a bit field of flags defined in {@link MessageFlags}. */ public static final String MESSAGE_FLAGS = "messageFlags"; /** * This integer column represents whether the user has specified that images should always * be shown. The value of "1" indicates that the user has specified that images should be * shown, while the value of "0" indicates that the user should be prompted before loading * any external images. */ public static final String ALWAYS_SHOW_IMAGES = "alwaysShowImages"; /** * This boolean column indicates whether the message has been read */ public static final String READ = "read"; /** * This boolean column indicates whether the message has been seen */ public static final String SEEN = "seen"; /** * This boolean column indicates whether the message has been starred */ public static final String STARRED = "starred"; /** * This integer column represents the offset in the message of quoted * text. If include_quoted_text is zero, the value contained in this * column is invalid. */ public static final String QUOTE_START_POS = "quotedTextStartPos"; /** * This string columns contains a JSON array of serialized {@link Attachment} objects. */ public static final String ATTACHMENTS = "attachments"; public static final String CUSTOM_FROM_ADDRESS = "customFrom"; /** * Uri of the account associated with this message. Except in the case * of showing a combined view, this column is almost always empty. */ public static final String MESSAGE_ACCOUNT_URI = "messageAccountUri"; /** * Intent Uri to launch when the user wants to view an event in their calendar, or null. */ public static final String EVENT_INTENT_URI = "eventIntentUri"; /** * This string column contains the string for the spam * warning of this message, or null if there is no spam warning for the message. */ public static final String SPAM_WARNING_STRING = "spamWarningString"; /** * This integer column contains the level of spam warning of this message, * or zero (0) if this message does not have a warning level. * See {@link SpamWarningLevel} for possible values. */ public static final String SPAM_WARNING_LEVEL = "spamWarningLevel"; /** * This integer column contains the type of link for the spam warning * of this message, or zero (0) if this message does not have a link type. * See {@link SpamWarningLinkType} for possible values. */ public static final String SPAM_WARNING_LINK_TYPE = "spamWarningLinkType"; /** * This string column contains the string for the via domain * to be included if this message was sent via an alternate * domain. This column should be null if no via domain exists. */ public static final String VIA_DOMAIN = "viaDomain"; /** * This boolean column indicates whether the message is an outgoing message in the process * of being sent (will be zero for incoming messages and messages that are already sent). */ public static final String IS_SENDING = "isSending"; private MessageColumns() {} } public static final class SetCurrentAccountColumns { /** * This column contains the Account object Parcelable. */ public static final String ACCOUNT = "account"; private SetCurrentAccountColumns() {} } /** * List of operations that can can be performed on a message. These operations are applied * with {@link ContentProvider#update(Uri, ContentValues, String, String[])} * where the message uri is specified, and the ContentValues specifies the operation to * be performed, e.g. values.put(RESPOND_COLUMN, RESPOND_ACCEPT) * * Note not all UI providers will support these operations. */ public static final class MessageOperations { /** * Respond to a calendar invitation */ public static final String RESPOND_COLUMN = "respond"; public static final int RESPOND_ACCEPT = 1; public static final int RESPOND_TENTATIVE = 2; public static final int RESPOND_DECLINE = 3; private MessageOperations() { } } public static final String ATTACHMENT_LIST_TYPE = "vnd.android.cursor.dir/vnd.com.android.mail.attachment"; public static final String ATTACHMENT_TYPE = "vnd.android.cursor.item/vnd.com.android.mail.attachment"; public static final String[] ATTACHMENT_PROJECTION = { AttachmentColumns.NAME, AttachmentColumns.SIZE, AttachmentColumns.URI, AttachmentColumns.CONTENT_TYPE, AttachmentColumns.STATE, AttachmentColumns.DESTINATION, AttachmentColumns.DOWNLOADED_SIZE, AttachmentColumns.CONTENT_URI, AttachmentColumns.THUMBNAIL_URI, AttachmentColumns.PREVIEW_INTENT_URI, AttachmentColumns.PROVIDER_DATA, AttachmentColumns.SUPPORTS_DOWNLOAD_AGAIN, AttachmentColumns.TYPE, AttachmentColumns.FLAGS }; public static final int ATTACHMENT_NAME_COLUMN = 0; public static final int ATTACHMENT_SIZE_COLUMN = 1; public static final int ATTACHMENT_URI_COLUMN = 2; public static final int ATTACHMENT_CONTENT_TYPE_COLUMN = 3; public static final int ATTACHMENT_STATE_COLUMN = 4; public static final int ATTACHMENT_DESTINATION_COLUMN = 5; public static final int ATTACHMENT_DOWNLOADED_SIZE_COLUMN = 6; public static final int ATTACHMENT_CONTENT_URI_COLUMN = 7; public static final int ATTACHMENT_THUMBNAIL_URI_COLUMN = 8; public static final int ATTACHMENT_PREVIEW_INTENT_COLUMN = 9; public static final int ATTACHMENT_SUPPORTS_DOWNLOAD_AGAIN_COLUMN = 10; public static final int ATTACHMENT_TYPE_COLUMN = 11; public static final int ATTACHMENT_FLAGS_COLUMN = 12; /** Separates attachment info parts in strings in the database. */ public static final String ATTACHMENT_INFO_SEPARATOR = "\n"; // use to join public static final Pattern ATTACHMENT_INFO_SEPARATOR_PATTERN = Pattern.compile(ATTACHMENT_INFO_SEPARATOR); // use to split public static final String ATTACHMENT_INFO_DELIMITER = "|"; // use to join // use to split public static final Pattern ATTACHMENT_INFO_DELIMITER_PATTERN = Pattern.compile("\\|"); /** * Valid states for the {@link AttachmentColumns#STATE} column. * */ public static final class AttachmentState { /** * The full attachment is not present on device. When used as a command, * setting this state will tell the provider to cancel a download in * progress. ** Valid next states: {@link #DOWNLOADING}, {@link #PAUSED} */ public static final int NOT_SAVED = 0; /** * The most recent attachment download attempt failed. The current UI * design does not require providers to persist this state, but * providers must return this state at least once after a download * failure occurs. This state may not be used as a command. *
* Valid next states: {@link #DOWNLOADING} */ public static final int FAILED = 1; /** * The attachment is currently being downloaded by the provider. * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current * download progress while in this state. When used as a command, * setting this state will tell the provider to initiate a download to * the accompanying destination in {@link AttachmentColumns#DESTINATION} * . *
* Valid next states: {@link #NOT_SAVED}, {@link #FAILED}, * {@link #SAVED} */ public static final int DOWNLOADING = 2; /** * The attachment was successfully downloaded to the destination in * {@link AttachmentColumns#DESTINATION}. If a provider later detects * that a download is missing, it should reset the state to * {@link #NOT_SAVED}. This state may not be used as a command on its * own. To move a file from cache to external, update * {@link AttachmentColumns#DESTINATION}. *
* Valid next states: {@link #NOT_SAVED}, {@link #PAUSED} */ public static final int SAVED = 3; /** * This is only used as a command, not as a state. The attachment is * currently being redownloaded by the provider. * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current * download progress while in this state. When used as a command, * setting this state will tell the provider to initiate a download to * the accompanying destination in {@link AttachmentColumns#DESTINATION} * . */ public static final int REDOWNLOADING = 4; /** * The attachment is either pending or paused in the download manager. * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current * download progress while in this state. This state may not be used as * a command on its own. *
* Valid next states: {@link #DOWNLOADING}, {@link #FAILED} */ public static final int PAUSED = 5; private AttachmentState() {} } public static final class AttachmentDestination { /** * The attachment will be or is already saved to the app-private cache partition. */ public static final int CACHE = 0; /** * The attachment will be or is already saved to external shared device storage. * This value should be 1 since saveToSd is often used in a similar way */ public static final int EXTERNAL = 1; private AttachmentDestination() {} } public static final class AttachmentColumns { /** * This string column is the attachment's file name, intended for display in UI. It is not * the full path of the file. */ public static final String NAME = OpenableColumns.DISPLAY_NAME; /** * This integer column is the file size of the attachment, in bytes. */ public static final String SIZE = OpenableColumns.SIZE; /** * This column is a {@link android.net.Uri} that can be queried to * monitor download state and progress for this individual attachment * (resulting cursor has one single row for this attachment). */ public static final String URI = "uri"; /** * This string column is the MIME type of the attachment. */ public static final String CONTENT_TYPE = "contentType"; /** * This integer column is the current downloading state of the * attachment as defined in {@link AttachmentState}. *
* Providers must accept updates to {@link #URI} with new values of * this column to initiate or cancel downloads. */ public static final String STATE = "state"; /** * This integer column is the file destination for the current download * in progress (when {@link #STATE} is * {@link AttachmentState#DOWNLOADING}) or the resulting downloaded file * ( when {@link #STATE} is {@link AttachmentState#SAVED}), as defined * in {@link AttachmentDestination}. This value is undefined in any * other state. *
* Providers must accept updates to {@link #URI} with new values of * this column to move an existing downloaded file. */ public static final String DESTINATION = "destination"; /** * This integer column is the current number of bytes downloaded when * {@link #STATE} is {@link AttachmentState#DOWNLOADING}. This value is * undefined in any other state. */ public static final String DOWNLOADED_SIZE = "downloadedSize"; /** * This column is a {@link android.net.Uri} that points to the * downloaded local file when {@link #STATE} is * {@link AttachmentState#SAVED}. This value is undefined in any other * state. */ public static final String CONTENT_URI = "contentUri"; /** * This column is a {@link android.net.Uri} that points to a local * thumbnail file for the attachment. Providers that do not support * downloading attachment thumbnails may leave this null. */ public static final String THUMBNAIL_URI = "thumbnailUri"; /** * This column is an {@link android.net.Uri} used in an * {@link android.content.Intent#ACTION_VIEW} Intent to launch a preview * activity that allows the user to efficiently view an attachment * without having to first download the entire file. Providers that do * not support previewing attachments may leave this null. */ public static final String PREVIEW_INTENT_URI = "previewIntentUri"; /** * This column contains provider-specific private data as JSON string. */ public static final String PROVIDER_DATA = "providerData"; /** * This column represents whether this attachment supports the ability to be downloaded * again. */ public static final String SUPPORTS_DOWNLOAD_AGAIN = "supportsDownloadAgain"; /** * This column represents the visibility type of this attachment. One of the * {@link AttachmentType} constants. */ public static final String TYPE = "type"; /** * This column holds various bitwise flags for status information. */ public static final String FLAGS = "flags"; private AttachmentColumns() {} } public static final class AttachmentContentValueKeys { public static final String RENDITION = "rendition"; public static final String ADDITIONAL_PRIORITY = "additionalPriority"; public static final String DELAY_DOWNLOAD = "delayDownload"; } /** * Indicates a version of an attachment. */ public static final class AttachmentRendition { /** A smaller or simpler version of the attachment, such as a scaled-down image or an HTML * version of a document. Not always available. */ public static final int SIMPLE = 0; /** * The full version of an attachment if it can be handled on the device, otherwise the * preview. */ public static final int BEST = 1; private static final String SIMPLE_STRING = "SIMPLE"; private static final String BEST_STRING = "BEST"; /** * Prefer renditions in this order. */ public static final int[] PREFERRED_RENDITIONS = new int[]{BEST, SIMPLE}; public static int parseRendition(String rendition) { if (TextUtils.equals(rendition, SIMPLE_STRING)) { return SIMPLE; } else if (TextUtils.equals(rendition, BEST_STRING)) { return BEST; } throw new IllegalArgumentException(String.format("Unknown rendition %s", rendition)); } public static String toString(int rendition) { if (rendition == BEST) { return BEST_STRING; } else if (rendition == SIMPLE) { return SIMPLE_STRING; } throw new IllegalArgumentException(String.format("Unknown rendition %d", rendition)); } } /** * Indicates the visibility type of an attachment. */ public static final class AttachmentType { public static final int STANDARD = 0; public static final int INLINE_CURRENT_MESSAGE = 1; public static final int INLINE_QUOTED_MESSAGE = 2; } public static final String[] UNDO_PROJECTION = { ConversationColumns.MESSAGE_LIST_URI }; public static final int UNDO_MESSAGE_LIST_COLUMN = 0; // Parameter used to indicate the sequence number for an undoable operation public static final String SEQUENCE_QUERY_PARAMETER = "seq"; /** * Parameter used to force UI notifications in an operation involving * {@link ConversationOperations#OPERATION_KEY}. */ public static final String FORCE_UI_NOTIFICATIONS_QUERY_PARAMETER = "forceUiNotifications"; /** * Parameter used to allow returning hidden folders. */ public static final String ALLOW_HIDDEN_FOLDERS_QUERY_PARAM = "allowHiddenFolders"; public static final String AUTO_ADVANCE_MODE_OLDER = "older"; public static final String AUTO_ADVANCE_MODE_NEWER = "newer"; public static final String AUTO_ADVANCE_MODE_LIST = "list"; /** * Settings for auto advancing when the current conversation has been destroyed. */ public static final class AutoAdvance { /** No setting specified. */ public static final int UNSET = 0; /** Go to the older message (if available) */ public static final int OLDER = 1; /** Go to the newer message (if available) */ public static final int NEWER = 2; /** Go back to conversation list*/ public static final int LIST = 3; /** The default option is to go to the list */ public static final int DEFAULT = LIST; /** * Gets the int value for the given auto advance setting. * * @param autoAdvanceSetting The string setting, such as "newer", "older", "list" */ public static int getAutoAdvanceInt(final String autoAdvanceSetting) { final int autoAdvance; if (AUTO_ADVANCE_MODE_NEWER.equals(autoAdvanceSetting)) { autoAdvance = UIProvider.AutoAdvance.NEWER; } else if (AUTO_ADVANCE_MODE_OLDER.equals(autoAdvanceSetting)) { autoAdvance = UIProvider.AutoAdvance.OLDER; } else if (AUTO_ADVANCE_MODE_LIST.equals(autoAdvanceSetting)) { autoAdvance = UIProvider.AutoAdvance.LIST; } else { autoAdvance = UIProvider.AutoAdvance.UNSET; } return autoAdvance; } } /** * Settings for what swipe should do. */ public static final class Swipe { /** Archive or remove label, if available. */ public static final int ARCHIVE = 0; /** Delete */ public static final int DELETE = 1; /** No swipe */ public static final int DISABLED = 2; /** Default is delete */ public static final int DEFAULT = ARCHIVE; } /** * Settings for Conversation view mode. */ public static final class ConversationViewMode { /** * The user hasn't specified a mode. */ public static final int UNDEFINED = -1; /** * Default to fit the conversation to screen view */ public static final int OVERVIEW = 0; /** * Conversation text size should be the device default, and wide conversations may * require panning */ public static final int READING = 1; public static final int DEFAULT = OVERVIEW; } public static final class SnapHeaderValue { public static final int ALWAYS = 0; public static final int PORTRAIT_ONLY = 1; public static final int NEVER = 2; } public static final class MessageTextSize { public static final int TINY = -2; public static final int SMALL = -1; public static final int NORMAL = 0; public static final int LARGE = 1; public static final int HUGE = 2; } public static final class DefaultReplyBehavior { public static final int REPLY = 0; public static final int REPLY_ALL = 1; } /** * Setting for whether to show sender images in conversation list. */ public static final class ConversationListIcon { public static final int SENDER_IMAGE = 1; public static final int NONE = 2; public static final int DEFAULT = 1; // Default to show sender image } /** * Action for an intent used to update/create new notifications. The mime type of this * intent should be set to the mimeType of the account that is generating this notification. * An intent of this action is required to have the following extras: * {@link UpdateNotificationExtras#EXTRA_FOLDER} {@link UpdateNotificationExtras#EXTRA_ACCOUNT} */ public static final String ACTION_UPDATE_NOTIFICATION = "com.android.mail.action.update_notification"; public static final class UpdateNotificationExtras { /** * Parcelable extra containing a {@link Uri} to a {@link Folder} */ public static final String EXTRA_FOLDER = "notification_extra_folder"; /** * Parcelable extra containing a {@link Uri} to an {@link Account} */ public static final String EXTRA_ACCOUNT = "notification_extra_account"; /** * Integer extra containing the update unread count for the account/folder. * If this value is 0, the UI will not block the intent to allow code to clear notifications * to run. */ public static final String EXTRA_UPDATED_UNREAD_COUNT = "notification_updated_unread_count"; } public static final class EditSettingsExtras { /** * Parcelable extra containing account for which the user wants to * modify settings */ public static final String EXTRA_ACCOUNT = "extra_account"; /** * Parcelable extra containing folder for which the user wants to * modify settings */ public static final String EXTRA_FOLDER = "extra_folder"; /** * Boolean extra which is set true if the user wants to "manage folders" */ public static final String EXTRA_MANAGE_FOLDERS = "extra_manage_folders"; } public static final class SendFeedbackExtras { /** * Optional boolean extras which indicates that the user is reporting a problem. */ public static final String EXTRA_REPORTING_PROBLEM = "reporting_problem"; /** * Optional Parcelable extra containing the screenshot of the screen where the user * is reporting a problem. */ public static final String EXTRA_SCREEN_SHOT = "screen_shot"; } public static final class ViewProxyExtras { /** * Uri extra passed to the proxy which indicates the original Uri that was intended to be * viewed. */ public static final String EXTRA_ORIGINAL_URI = "original_uri"; /** * Parcelable extra passed to the proxy which indicates the account being viewed from. */ public static final String EXTRA_ACCOUNT = "account"; /** * String extra passed from the proxy which indicates the salt used to generate the digest. */ public static final String EXTRA_SALT = "salt"; /** * Byte[] extra passed from the proxy which indicates the digest of the salted account name. */ public static final String EXTRA_ACCOUNT_DIGEST = "digest"; } }