blob: 154166de0198b190197ee3180b11c96f59b5a0bb [file] [log] [blame]
Vikram Aggarwal4f9a4c52012-01-11 15:04:55 -08001/*******************************************************************************
2 * Copyright (C) 2011 Google Inc.
3 * Licensed to The Android Open Source Project.
Mindy Pereira6f92de62011-12-19 11:31:48 -08004 *
Vikram Aggarwal4f9a4c52012-01-11 15:04:55 -08005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
Mindy Pereira6f92de62011-12-19 11:31:48 -08008 *
Vikram Aggarwal4f9a4c52012-01-11 15:04:55 -08009 * http://www.apache.org/licenses/LICENSE-2.0
Mindy Pereira6f92de62011-12-19 11:31:48 -080010 *
Vikram Aggarwal4f9a4c52012-01-11 15:04:55 -080011 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
Mindy Pereira6f92de62011-12-19 11:31:48 -080017
Andy Huang30e2c242012-01-06 18:14:30 -080018package com.android.mail.providers;
Mindy Pereira6f92de62011-12-19 11:31:48 -080019
Alice Yang64273142013-04-10 18:26:56 -070020import android.content.ContentProvider;
21import android.content.ContentValues;
Andy Huangd521baf2013-05-21 18:08:08 -070022import android.database.Cursor;
Alice Yang64273142013-04-10 18:26:56 -070023import android.net.Uri;
Andy Huang7f39bbd2013-05-20 20:36:38 -070024import android.os.Bundle;
Andy Huangd521baf2013-05-21 18:08:08 -070025import android.os.Parcelable;
Mindy Pereira6f92de62011-12-19 11:31:48 -080026import android.provider.BaseColumns;
Paul Westbrookc97d8ac2012-03-23 15:21:48 -070027import android.provider.OpenableColumns;
Mindy Pereira82cc5662012-01-09 17:29:30 -080028import android.text.TextUtils;
29
Tony Mantler42fe4862013-10-23 11:39:19 -070030import com.google.common.collect.ImmutableList;
Alice Yang64273142013-04-10 18:26:56 -070031import com.google.common.collect.ImmutableMap;
Mindy Pereira6f92de62011-12-19 11:31:48 -080032
Andy Huangbab92212012-11-16 18:32:18 -080033import java.util.Map;
Mark Wei479505d2013-03-21 06:04:46 -070034import java.util.regex.Pattern;
Paul Westbrook82ea6da2011-12-15 11:03:51 -080035
Mindy Pereira6f92de62011-12-19 11:31:48 -080036public class UIProvider {
Mindy Pereira048b5c82012-04-02 11:11:33 -070037 public static final String EMAIL_SEPARATOR = ",";
Mindy Pereira326c6602012-01-04 15:32:42 -080038 public static final long INVALID_CONVERSATION_ID = -1;
39 public static final long INVALID_MESSAGE_ID = -1;
40
Marc Blank9ace18a2012-02-21 16:34:07 -080041 /**
42 * Values for the current state of a Folder/Account; note that it's possible that more than one
43 * sync is in progress
44 */
45 public static final class SyncStatus {
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070046 /**
47 * No sync in progress
48 */
Paul Westbrookc808fac2012-02-22 16:42:18 -080049 public static final int NO_SYNC = 0;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070050 /**
51 * A user-requested sync/refresh is in progress. This occurs when the user taps on the
52 * refresh icon in the action bar.
53 */
Paul Westbrookc808fac2012-02-22 16:42:18 -080054 public static final int USER_REFRESH = 1<<0;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070055 /**
56 * A user-requested live query is in progress. This occurs when the user goes past the end
57 * of the fetched results in the conversation list.
58 */
59 public static final int LIVE_QUERY = 1<<1;
60 /** Please use the constant {@link #LIVE_QUERY} instead. */
61 @Deprecated
Paul Westbrookc808fac2012-02-22 16:42:18 -080062 public static final int USER_QUERY = 1<<1;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070063 /**
64 * A background sync is in progress. This happens on <b>no</b> user interaction.
65 */
66 public static final int BACKGROUND_SYNC = 1<<2;
67 /**
68 * An initial sync is needed for this Account/Folder to be used. This is account-wide, when
69 * the user has added an account, and the first sync has not completed successfully.
70 */
71 public static final int INITIAL_SYNC_NEEDED = 1<<3;
72 /**
73 * Manual sync is required. This is account-wide, when the user has disabled sync on the
74 * Gmail account.
75 */
76 public static final int MANUAL_SYNC_REQUIRED = 1<<4;
Paul Westbrookdfa1dec2012-09-26 16:27:28 -070077 /**
78 * Account initialization is required.
79 */
80 public static final int ACCOUNT_INITIALIZATION_REQUIRED = 1<<5;
Mindy Pereira70a70c92012-08-02 08:39:45 -070081
82 public static boolean isSyncInProgress(int syncStatus) {
83 return 0 != (syncStatus & (BACKGROUND_SYNC |
84 USER_REFRESH |
Vikram Aggarwald31f0cf2013-01-18 15:34:40 -080085 LIVE_QUERY));
Mindy Pereira70a70c92012-08-02 08:39:45 -070086 }
Marc Blank9ace18a2012-02-21 16:34:07 -080087 }
88
89 /**
90 * Values for the result of the last attempted sync of a Folder/Account
91 */
92 public static final class LastSyncResult {
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070093 /** The sync completed successfully */
Marc Blank9ace18a2012-02-21 16:34:07 -080094 public static final int SUCCESS = 0;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070095 /** The sync wasn't completed due to a connection error */
Marc Blank9ace18a2012-02-21 16:34:07 -080096 public static final int CONNECTION_ERROR = 1;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070097 /** The sync wasn't completed due to an authentication error */
Marc Blank9ace18a2012-02-21 16:34:07 -080098 public static final int AUTH_ERROR = 2;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -070099 /** The sync wasn't completed due to a security error */
Marc Blank9ace18a2012-02-21 16:34:07 -0800100 public static final int SECURITY_ERROR = 3;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -0700101 /** The sync wasn't completed due to a low memory condition */
Marc Blank9ace18a2012-02-21 16:34:07 -0800102 public static final int STORAGE_ERROR = 4;
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -0700103 /** The sync wasn't completed due to an internal error/exception */
Marc Blank9ace18a2012-02-21 16:34:07 -0800104 public static final int INTERNAL_ERROR = 5;
James Lemieux55d07252014-01-30 12:00:03 -0800105 /** The sync wasn't completed due to an error in the mail server */
106 public static final int SERVER_ERROR = 6;
Marc Blank9ace18a2012-02-21 16:34:07 -0800107 }
108
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800109 // The actual content provider should define its own authority
Andy Huang30e2c242012-01-06 18:14:30 -0800110 public static final String AUTHORITY = "com.android.mail.providers";
Mindy Pereira6f92de62011-12-19 11:31:48 -0800111
112 public static final String ACCOUNT_LIST_TYPE =
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800113 "vnd.android.cursor.dir/vnd.com.android.mail.account";
Mindy Pereira6f92de62011-12-19 11:31:48 -0800114 public static final String ACCOUNT_TYPE =
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800115 "vnd.android.cursor.item/vnd.com.android.mail.account";
Mindy Pereira6f92de62011-12-19 11:31:48 -0800116
Paul Westbrook2d82d612012-03-07 09:21:14 -0800117 /**
118 * Query parameter key that can be used to control the behavior of list queries. The value
119 * must be a serialized {@link ListParams} object. UIProvider implementations are not
120 * required to respect this query parameter
121 */
122 public static final String LIST_PARAMS_QUERY_PARAMETER = "listParams";
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800123 public static final String LABEL_QUERY_PARAMETER = "label";
124 public static final String SEEN_QUERY_PARAMETER = "seen";
Paul Westbrook2d82d612012-03-07 09:21:14 -0800125
Scott Kennedy41c16942013-07-11 17:16:28 -0700126 /**
127 * Query parameter that can be used to specify a parent for a the returned folder object from a
128 * query. When set, if a folder is returned that does not have a true parent, it will use this
129 * uri as its parent uri.
130 */
131 public static final String DEFAULT_PARENT_QUERY_PARAMETER = "defaultParent";
132
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800133 public static final Map<String, Class<?>> ACCOUNTS_COLUMNS_NO_CAPABILITIES =
Andy Huangbab92212012-11-16 18:32:18 -0800134 new ImmutableMap.Builder<String, Class<?>>()
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800135 .put(AccountColumns._ID, Integer.class)
Andy Huangbab92212012-11-16 18:32:18 -0800136 .put(AccountColumns.NAME, String.class)
Tony Mantlerbb036ff72013-10-18 14:03:43 -0700137 .put(AccountColumns.SENDER_NAME, String.class)
Tony Mantler3e166872013-09-24 16:39:18 -0700138 .put(AccountColumns.ACCOUNT_MANAGER_NAME, String.class)
Scott Kennedye5883802013-04-14 14:33:20 -0700139 .put(AccountColumns.TYPE, String.class)
Andy Huangbab92212012-11-16 18:32:18 -0800140 .put(AccountColumns.PROVIDER_VERSION, Integer.class)
141 .put(AccountColumns.URI, String.class)
Andy Huangbab92212012-11-16 18:32:18 -0800142 .put(AccountColumns.FOLDER_LIST_URI, String.class)
143 .put(AccountColumns.FULL_FOLDER_LIST_URI, String.class)
Tony Mantler009f1b52013-09-20 14:32:23 -0700144 .put(AccountColumns.ALL_FOLDER_LIST_URI, String.class)
Andy Huangbab92212012-11-16 18:32:18 -0800145 .put(AccountColumns.SEARCH_URI, String.class)
146 .put(AccountColumns.ACCOUNT_FROM_ADDRESSES, String.class)
Andy Huangbab92212012-11-16 18:32:18 -0800147 .put(AccountColumns.EXPUNGE_MESSAGE_URI, String.class)
148 .put(AccountColumns.UNDO_URI, String.class)
149 .put(AccountColumns.SETTINGS_INTENT_URI, String.class)
150 .put(AccountColumns.SYNC_STATUS, Integer.class)
151 .put(AccountColumns.HELP_INTENT_URI, String.class)
152 .put(AccountColumns.SEND_FEEDBACK_INTENT_URI, String.class)
153 .put(AccountColumns.REAUTHENTICATION_INTENT_URI, String.class)
154 .put(AccountColumns.COMPOSE_URI, String.class)
155 .put(AccountColumns.MIME_TYPE, String.class)
156 .put(AccountColumns.RECENT_FOLDER_LIST_URI, String.class)
157 .put(AccountColumns.COLOR, Integer.class)
158 .put(AccountColumns.DEFAULT_RECENT_FOLDER_LIST_URI, String.class)
159 .put(AccountColumns.MANUAL_SYNC_URI, String.class)
160 .put(AccountColumns.VIEW_INTENT_PROXY_URI, String.class)
161 .put(AccountColumns.ACCOUNT_COOKIE_QUERY_URI, String.class)
162 .put(AccountColumns.SettingsColumns.SIGNATURE, String.class)
163 .put(AccountColumns.SettingsColumns.AUTO_ADVANCE, Integer.class)
164 .put(AccountColumns.SettingsColumns.MESSAGE_TEXT_SIZE, Integer.class)
165 .put(AccountColumns.SettingsColumns.SNAP_HEADERS, Integer.class)
166 .put(AccountColumns.SettingsColumns.REPLY_BEHAVIOR, Integer.class)
Scott Kennedy251d6c42013-04-23 16:46:24 -0700167 .put(AccountColumns.SettingsColumns.CONV_LIST_ICON, Integer.class)
Mark Weiaa76bdf2013-08-06 18:20:11 -0700168 .put(AccountColumns.SettingsColumns.CONV_LIST_ATTACHMENT_PREVIEWS, Integer.class)
Andy Huangbab92212012-11-16 18:32:18 -0800169 .put(AccountColumns.SettingsColumns.CONFIRM_DELETE, Integer.class)
170 .put(AccountColumns.SettingsColumns.CONFIRM_ARCHIVE, Integer.class)
171 .put(AccountColumns.SettingsColumns.CONFIRM_SEND, Integer.class)
172 .put(AccountColumns.SettingsColumns.DEFAULT_INBOX, String.class)
173 .put(AccountColumns.SettingsColumns.DEFAULT_INBOX_NAME, String.class)
174 .put(AccountColumns.SettingsColumns.FORCE_REPLY_FROM_DEFAULT, Integer.class)
175 .put(AccountColumns.SettingsColumns.MAX_ATTACHMENT_SIZE, Integer.class)
176 .put(AccountColumns.SettingsColumns.SWIPE, Integer.class)
Andrew Sapperstein17646052014-03-06 21:51:17 -0800177 .put(AccountColumns.SettingsColumns.IMPORTANCE_MARKERS_ENABLED, Integer.class)
178 .put(AccountColumns.SettingsColumns.SHOW_CHEVRONS_ENABLED, Integer.class)
Andy Huangbab92212012-11-16 18:32:18 -0800179 .put(AccountColumns.SettingsColumns.SETUP_INTENT_URI, String.class)
180 .put(AccountColumns.SettingsColumns.CONVERSATION_VIEW_MODE, Integer.class)
Vikram Aggarwal69a6cdf2013-01-08 16:05:17 -0800181 .put(AccountColumns.SettingsColumns.VEILED_ADDRESS_PATTERN, String.class)
Andy Huangbab92212012-11-16 18:32:18 -0800182 .put(AccountColumns.UPDATE_SETTINGS_URI, String.class)
Alice Yang3617b412013-05-10 00:30:07 -0700183 .put(AccountColumns.ENABLE_MESSAGE_TRANSFORMS, Integer.class)
Alice Yangc86b1fb2013-08-11 22:27:25 -0700184 .put(AccountColumns.SYNC_AUTHORITY, String.class)
Tony Mantler59e69092013-08-14 11:05:00 -0700185 .put(AccountColumns.QUICK_RESPONSE_URI, String.class)
Scott Kennedydd2ec682013-06-03 19:16:13 -0700186 .put(AccountColumns.SettingsColumns.MOVE_TO_INBOX, String.class)
Alice Yangf323c042013-10-30 00:15:02 -0700187 .put(AccountColumns.SettingsColumns.SHOW_IMAGES, Integer.class)
Andy Huangbab92212012-11-16 18:32:18 -0800188 .build();
189
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800190 public static final Map<String, Class<?>> ACCOUNTS_COLUMNS =
191 new ImmutableMap.Builder<String, Class<?>>()
192 .putAll(ACCOUNTS_COLUMNS_NO_CAPABILITIES)
193 .put(AccountColumns.CAPABILITIES, Integer.class)
194 .build();
Mindy Pereira6f92de62011-12-19 11:31:48 -0800195
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800196 // pull out the keyset from above to form the projection
197 public static final String[] ACCOUNTS_PROJECTION =
198 ACCOUNTS_COLUMNS.keySet().toArray(new String[ACCOUNTS_COLUMNS.size()]);
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700199
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800200 public static final
201 String[] ACCOUNTS_PROJECTION_NO_CAPABILITIES = ACCOUNTS_COLUMNS_NO_CAPABILITIES.keySet()
202 .toArray(new String[ACCOUNTS_COLUMNS_NO_CAPABILITIES.size()]);
Scott Kennedy0d0f8b02012-10-12 15:18:18 -0700203
Mindy Pereira6f92de62011-12-19 11:31:48 -0800204 public static final class AccountCapabilities {
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800205 /**
206 * Whether folders can be synchronized back to the server.
207 */
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800208 public static final int SYNCABLE_FOLDERS = 0x0001;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800209 /**
210 * Whether the server allows reporting spam back.
211 */
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800212 public static final int REPORT_SPAM = 0x0002;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800213 /**
Paul Westbrook77eee622012-07-10 13:41:57 -0700214 * Whether the server allows reporting phishing back.
215 */
216 public static final int REPORT_PHISHING = 0x0004;
217 /**
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800218 * Whether the server supports a concept of Archive: removing mail from the Inbox but
219 * keeping it around.
220 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700221 public static final int ARCHIVE = 0x0008;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800222 /**
223 * Whether the server will stop notifying on updates to this thread? This requires
224 * THREADED_CONVERSATIONS to be true, otherwise it should be ignored.
225 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700226 public static final int MUTE = 0x0010;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800227 /**
228 * Whether the server supports searching over all messages. This requires SYNCABLE_FOLDERS
229 * to be true, otherwise it should be ignored.
230 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700231 public static final int SERVER_SEARCH = 0x0020;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800232 /**
233 * Whether the server supports constraining search to a single folder. Requires
234 * SYNCABLE_FOLDERS, otherwise it should be ignored.
235 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700236 public static final int FOLDER_SERVER_SEARCH = 0x0040;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800237 /**
238 * Whether the server sends us sanitized HTML (guaranteed to not contain malicious HTML).
239 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700240 public static final int SANITIZED_HTML = 0x0080;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800241 /**
242 * Whether the server allows synchronization of draft messages. This does NOT require
243 * SYNCABLE_FOLDERS to be set.
244 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700245 public static final int DRAFT_SYNCHRONIZATION = 0x0100;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800246 /**
247 * Does the server allow the user to compose mails (and reply) using addresses other than
248 * their account name? For instance, GMail allows users to set FROM addresses that are
249 * different from account@gmail.com address. For instance, user@gmail.com could have another
250 * FROM: address like user@android.com. If the user has enabled multiple FROM address, he
251 * can compose (and reply) using either address.
252 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700253 public static final int MULTIPLE_FROM_ADDRESSES = 0x0200;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800254 /**
255 * Whether the server allows the original message to be included in the reply by setting a
256 * flag on the reply. If we can avoid including the entire previous message, we save on
257 * bandwidth (replies are shorter).
258 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700259 public static final int SMART_REPLY = 0x0400;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800260 /**
261 * Does this account support searching locally, on the device? This requires the backend
262 * storage to support a mechanism for searching.
263 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700264 public static final int LOCAL_SEARCH = 0x0800;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800265 /**
266 * Whether the server supports a notion of threaded conversations: where replies to messages
267 * are tagged to keep conversations grouped. This could be full threading (each message
268 * lists its parent) or conversation-level threading (each message lists one conversation
269 * which it belongs to)
270 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700271 public static final int THREADED_CONVERSATIONS = 0x1000;
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800272 /**
273 * Whether the server supports allowing a conversation to be in multiple folders. (Or allows
Mindy Pereira30fd47b2012-03-09 09:24:00 -0800274 * multiple folders on a single conversation)
Vikram Aggarwal859681b2012-02-03 10:02:24 -0800275 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700276 public static final int MULTIPLE_FOLDERS_PER_CONV = 0x2000;
Mindy Pereira343ffeb2012-02-22 10:12:14 -0800277 /**
278 * Whether the provider supports undoing operations. If it doesn't, never show the undo bar.
279 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700280 public static final int UNDO = 0x4000;
Paul Westbrook94e440d2012-02-24 11:03:47 -0800281 /**
282 * Whether the account provides help content.
283 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700284 public static final int HELP_CONTENT = 0x8000;
Mindy Pereira7f0a9622012-02-29 15:00:34 -0800285 /**
Paul Westbrook517743e2012-03-22 10:40:46 -0700286 * Whether the account provides a way to send feedback content.
287 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700288 public static final int SEND_FEEDBACK = 0x10000;
Paul Westbrook517743e2012-03-22 10:40:46 -0700289 /**
Mindy Pereira7f0a9622012-02-29 15:00:34 -0800290 * Whether the account provides a mechanism for marking conversations as important.
291 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700292 public static final int MARK_IMPORTANT = 0x20000;
Marc Blank51144942012-03-20 13:59:32 -0700293 /**
294 * Whether initial conversation queries should use a limit parameter
295 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700296 public static final int INITIAL_CONVERSATION_LIMIT = 0x40000;
Marc Blankd3707922012-04-24 11:51:50 -0700297 /**
298 * Whether the account cannot be used for sending
299 */
Paul Westbrook77eee622012-07-10 13:41:57 -0700300 public static final int SENDING_UNAVAILABLE = 0x80000;
Paul Westbrookef362542012-08-27 14:53:32 -0700301 /**
302 * Whether the account supports discarding drafts from a conversation. This should be
303 * removed when all providers support this capability
304 */
305 public static final int DISCARD_CONVERSATION_DRAFTS = 0x100000;
Scott Kennedy7ee089e2013-03-25 17:05:44 -0400306 /**
307 * Whether the account supports emptying the trash folder
308 */
309 public static final int EMPTY_TRASH = 0x200000;
310 /**
311 * Whether the account supports emptying the spam folder
312 */
313 public static final int EMPTY_SPAM = 0x400000;
Scott Kennedy0e8dc842013-09-10 11:13:53 -0700314 /**
315 * Whether the account supports nested folders
316 */
317 public static final int NESTED_FOLDERS = 0x800000;
Mindy Pereira6f92de62011-12-19 11:31:48 -0800318 }
319
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800320 public static final class AccountColumns implements BaseColumns {
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800321 /**
322 * This string column contains the human visible name for the account.
323 */
Mindy Pereira6f92de62011-12-19 11:31:48 -0800324 public static final String NAME = "name";
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800325
326 /**
Tony Mantlerbb036ff72013-10-18 14:03:43 -0700327 * This string column contains the real name associated with the account, e.g. "John Doe"
328 */
329 public static final String SENDER_NAME = "senderName";
330
331 /**
Tony Mantler3e166872013-09-24 16:39:18 -0700332 * This string column contains the account manager name of this account.
333 */
334
335 public static final String ACCOUNT_MANAGER_NAME = "accountManagerName";
336
337 /**
Vikram Aggarwal6dde1782012-03-12 17:16:48 -0700338 * This integer contains the type of the account: Google versus non google. This is not
339 * returned by the UIProvider, rather this is a notion in the system.
340 */
341 public static final String TYPE = "type";
342
343 /**
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800344 * This integer column returns the version of the UI provider schema from which this
345 * account provider will return results.
346 */
Mindy Pereira6f92de62011-12-19 11:31:48 -0800347 public static final String PROVIDER_VERSION = "providerVersion";
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800348
349 /**
350 * This string column contains the uri to directly access the information for this account.
351 */
Mindy Pereira6349a042012-01-04 11:25:01 -0800352 public static final String URI = "accountUri";
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800353
354 /**
Andy Huange0b83b82012-03-06 19:57:04 -0800355 * This integer column contains a bit field of the possible capabilities that this account
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800356 * supports.
357 */
Mindy Pereira6f92de62011-12-19 11:31:48 -0800358 public static final String CAPABILITIES = "capabilities";
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800359
360 /**
Mindy Pereira750cc732011-12-21 13:32:29 -0800361 * This string column contains the content provider uri to return the
362 * list of top level folders for this account.
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800363 */
Mindy Pereira6f92de62011-12-19 11:31:48 -0800364 public static final String FOLDER_LIST_URI = "folderListUri";
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800365
366 /**
Mindy Pereira31d79672012-06-26 14:43:09 -0700367 * This string column contains the content provider uri to return the
Tony Mantler009f1b52013-09-20 14:32:23 -0700368 * list of all real folders for this account.
Mindy Pereira31d79672012-06-26 14:43:09 -0700369 */
370 public static final String FULL_FOLDER_LIST_URI = "fullFolderListUri";
371
372 /**
Tony Mantler009f1b52013-09-20 14:32:23 -0700373 * This string column contains the content provider uri to return the
374 * list of all real and synthetic folders for this account.
375 */
376 public static final String ALL_FOLDER_LIST_URI = "allFolderListUri";
377
378 /**
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800379 * This string column contains the content provider uri that can be queried for search
380 * results.
Paul Westbrook8130e6f2012-03-06 13:51:01 -0800381 * The supported query parameters are limited to those listed
Andy Huangd8e249e2012-03-21 17:01:37 -0700382 * in {@link SearchQueryParameters}
Paul Westbrook1475a7a2012-03-08 15:06:27 -0800383 * The cursor returned from this query is expected have one row, where the columnm are a
Andy Huangd8e249e2012-03-21 17:01:37 -0700384 * subset of the columns specified in {@link FolderColumns}
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800385 */
Mindy Pereira6f92de62011-12-19 11:31:48 -0800386 public static final String SEARCH_URI = "searchUri";
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800387
388 /**
Mindy Pereira92551d02012-04-05 11:31:12 -0700389 * This string column contains a json array of json objects representing
390 * custom from addresses for this account or null if there are none.
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800391 */
Mindy Pereira92551d02012-04-05 11:31:12 -0700392 public static final String ACCOUNT_FROM_ADDRESSES = "accountFromAddresses";
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800393
394 /**
Mindy Pereira82cc5662012-01-09 17:29:30 -0800395 * This string column contains the content provider uri that can be used
396 * to expunge a message from this account. NOTE: This might be better to
397 * be an update operation on the messageUri.
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -0700398 * When {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[])}
399 * is called with this uri, the {@link ContentValues} object is expected to have
400 * {@link BaseColumns#_ID} specified with the local message id of the message.
Mindy Pereira82cc5662012-01-09 17:29:30 -0800401 */
402 public static final String EXPUNGE_MESSAGE_URI = "expungeMessageUri";
Mindy Pereira96b5c352012-02-01 11:33:40 -0800403
404 /**
405 * This string column contains the content provider uri that can be used
406 * to undo the last committed action.
407 */
Mindy Pereira9600dac2012-02-17 15:59:25 -0800408 public static final String UNDO_URI = "undoUri";
Paul Westbrook2861b6a2012-02-15 15:25:34 -0800409
410 /**
Paul Westbrook9912eee2012-02-22 14:49:03 -0800411 * Uri for EDIT intent that will cause the settings screens for this account type to be
Paul Westbrook2861b6a2012-02-15 15:25:34 -0800412 * shown.
Paul Westbrooke5503552012-03-28 00:35:57 -0700413 * Optionally, extra values from {@link EditSettingsExtras} can be used to indicate
414 * which settings the user wants to edit.
Paul Westbrook2861b6a2012-02-15 15:25:34 -0800415 * TODO: When we want to support a heterogeneous set of account types, this value may need
416 * to be moved to a global content provider.
417 */
Paul Westbrookb8911732013-04-28 11:54:49 -0700418 public static final String SETTINGS_INTENT_URI = "accountSettingsIntentUri";
Marc Blank9ace18a2012-02-21 16:34:07 -0800419
420 /**
Paul Westbrook94e440d2012-02-24 11:03:47 -0800421 * Uri for VIEW intent that will cause the help screens for this account type to be
422 * shown.
423 * TODO: When we want to support a heterogeneous set of account types, this value may need
424 * to be moved to a global content provider.
425 */
Paul Westbrookb8911732013-04-28 11:54:49 -0700426 public static final String HELP_INTENT_URI = "helpIntentUri";
Paul Westbrook94e440d2012-02-24 11:03:47 -0800427
428 /**
Paul Westbrook517743e2012-03-22 10:40:46 -0700429 * Uri for VIEW intent that will cause the send feedback for this account type to be
430 * shown.
431 * TODO: When we want to support a heterogeneous set of account types, this value may need
432 * to be moved to a global content provider.
433 */
Paul Westbrookb8911732013-04-28 11:54:49 -0700434 public static final String SEND_FEEDBACK_INTENT_URI = "sendFeedbackIntentUri";
Paul Westbrook517743e2012-03-22 10:40:46 -0700435
436 /**
Paul Westbrook122f7c22012-08-20 17:50:31 -0700437 * Uri for VIEW intent that will cause the user to be prompted for authentication for
438 * this account. startActivityForResult() will be called with this intent. Activities that
Vikram Aggarwal41b9e8f2012-09-25 10:15:04 -0700439 * handle this intent are expected to return {@link android.app.Activity#RESULT_OK} if the
Paul Westbrook122f7c22012-08-20 17:50:31 -0700440 * user successfully authenticated.
441 */
Paul Westbrookb8911732013-04-28 11:54:49 -0700442 public static final String REAUTHENTICATION_INTENT_URI = "reauthenticationUri";
Paul Westbrook122f7c22012-08-20 17:50:31 -0700443
444 /**
Marc Blank9ace18a2012-02-21 16:34:07 -0800445 * This int column contains the current sync status of the account (the logical AND of the
446 * sync status of folders in this account)
447 */
448 public static final String SYNC_STATUS = "syncStatus";
Mindy Pereira23755e22012-02-27 13:58:04 -0800449 /**
450 * Uri for VIEW intent that will cause the compose screens for this type
451 * of account to be shown.
452 */
453 public static final String COMPOSE_URI = "composeUri";
Mindy Pereira898cd382012-03-06 08:42:47 -0800454 /**
455 * Mime-type defining this account.
456 */
457 public static final String MIME_TYPE = "mimeType";
Vikram Aggarwal27e85f22012-03-05 16:29:17 -0800458 /**
459 * URI for location of recent folders viewed on this account.
460 */
461 public static final String RECENT_FOLDER_LIST_URI = "recentFolderListUri";
Marc Blankb2878332012-05-17 15:16:59 -0700462 /**
Vikram Aggarwal27d89ad2012-06-12 13:38:40 -0700463 * URI for default recent folders for this account, if any.
464 */
465 public static final String DEFAULT_RECENT_FOLDER_LIST_URI = "defaultRecentFolderListUri";
466 /**
Andy Huangbab92212012-11-16 18:32:18 -0800467 * Color (integer) used for this account (for Email/Combined view)
Marc Blankb2878332012-05-17 15:16:59 -0700468 */
469 public static final String COLOR = "color";
Mindy Pereirab378d642012-07-11 09:46:20 -0700470 /**
471 * URI for forcing a manual sync of this account.
472 */
473 public static final String MANUAL_SYNC_URI = "manualSyncUri";
Mark Wei9982fdb2012-08-30 18:27:46 -0700474 /**
475 * Optional URI of this account for proxying view intents.
476 */
477 public static final String VIEW_INTENT_PROXY_URI = "viewProxyUri";
Paul Westbrookb8361c92012-09-27 10:57:14 -0700478 /**
479 * Optional URI for querying for the cookie needed for accessing inline content. The cookie
480 * specified here will be set on the uri specified in the
481 * {@link ConversationColumns#CONVERSATION_BASE_URI} column. The cursor returned from this
482 * query is expected have one row, where the columns are specified in
483 * {@link AccountCookieColumns}
484 */
485 public static final String ACCOUNT_COOKIE_QUERY_URI = "accountCookieUri";
Scott Kennedy0d0f8b02012-10-12 15:18:18 -0700486 /**
487 * URI to be used with an update() ContentResolver call with a {@link ContentValues} object
488 * where the keys are from the {@link AccountColumns.SettingsColumns}, and the values are
489 * the new values.
490 */
491 public static final String UPDATE_SETTINGS_URI = "updateSettingsUri";
Alice Yang3617b412013-05-10 00:30:07 -0700492 /**
493 * Whether message transforms (HTML DOM manipulation) should be enabled.
494 */
495 public static final String ENABLE_MESSAGE_TRANSFORMS = "enableMessageTransforms";
Alice Yangc86b1fb2013-08-11 22:27:25 -0700496 /**
497 * Sync authority to use.
498 */
499 public static final String SYNC_AUTHORITY = "syncAuthority";
Tony Mantler59e69092013-08-14 11:05:00 -0700500 /**
501 * URI for querying this account's quick responses
502 */
503 public static final String QUICK_RESPONSE_URI = "quickResponseUri";
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700504
505 public static final class SettingsColumns {
506 /**
507 * String column containing the contents of the signature for this account. If no
508 * signature has been specified, the value will be null.
509 */
510 public static final String SIGNATURE = "signature";
511
512 /**
513 * Integer column containing the user's specified auto-advance policy. This value will
514 * be one of the values in {@link UIProvider.AutoAdvance}
515 */
516 public static final String AUTO_ADVANCE = "auto_advance";
517
518 /**
519 * Integer column containing the user's specified message text size preference. This
520 * value will be one of the values in {@link UIProvider.MessageTextSize}
521 */
522 public static final String MESSAGE_TEXT_SIZE = "message_text_size";
523
524 /**
525 * Integer column contaning the user's specified snap header preference. This value
526 * will be one of the values in {@link UIProvider.SnapHeaderValue}
527 */
528 public static final String SNAP_HEADERS = "snap_headers";
529
530 /**
531 * Integer column containing the user's specified default reply behavior. This value
532 * will be one of the values in {@link UIProvider.DefaultReplyBehavior}
533 */
534 public static final String REPLY_BEHAVIOR = "reply_behavior";
535
536 /**
Alice Yang4a53f5b2013-05-02 16:10:48 -0700537 * Integer column containing the user's preference for whether to show sender images
538 * or not in the conversation list view. This value will be one of the values in
539 * {@link UIProvider.ConversationListIcon}.
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700540 */
Alice Yang64273142013-04-10 18:26:56 -0700541 public static final String CONV_LIST_ICON = "conversation_list_icon";
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700542
543 /**
Mark Weiaa76bdf2013-08-06 18:20:11 -0700544 * Integer column containing the user's preference for whether to show attachment
545 * previews or not in the conversation list view. A non zero value indicates that
546 * attachment previews should be displayed.
547 */
548 public static final String CONV_LIST_ATTACHMENT_PREVIEWS
549 = "conversation_list_attachment_previews";
550
551 /**
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700552 * Integer column containing the user's specified confirm delete preference value.
553 * A non zero value indicates that the user has indicated that a confirmation should
554 * be shown when a delete action is performed.
555 */
556 public static final String CONFIRM_DELETE = "confirm_delete";
557
558 /**
559 * Integer column containing the user's specified confirm archive preference value.
560 * A non zero value indicates that the user has indicated that a confirmation should
561 * be shown when an archive action is performed.
562 */
563 public static final String CONFIRM_ARCHIVE = "confirm_archive";
564
565 /**
566 * Integer column containing the user's specified confirm send preference value.
567 * A non zero value indicates that the user has indicated that a confirmation should
568 * be shown when a send action is performed.
569 */
570 public static final String CONFIRM_SEND = "confirm_send";
571 /**
Mindy Pereira571de222012-07-20 09:28:44 -0700572 * String containing the URI for the default inbox for this account.
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700573 */
574 public static final String DEFAULT_INBOX = "default_inbox";
575 /**
Vikram Aggarwal5e63e8a2012-07-19 10:05:24 -0700576 * String containing the name of the default Inbox for this account
577 */
578 public static final String DEFAULT_INBOX_NAME = "default_inbox_name";
579 /**
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700580 * Integer column containing a non zero value if replies should always be sent from
581 * a default address instead of a recipient.
582 */
Mindy Pereira3cd4f402012-07-17 11:16:18 -0700583 public static final String FORCE_REPLY_FROM_DEFAULT = "force_reply_from_default";
584 /**
585 * Integer column containing the max attachment size in kb.
586 */
587 public static final String MAX_ATTACHMENT_SIZE = "max_attachment_size";
Mindy Pereira71a8f5e2012-07-25 14:33:18 -0700588 /**
589 * Integer column containing a value matching one of the constants from {@link Swipe}
590 */
591 public static final String SWIPE = "swipe";
Vikram Aggarwal707f24c2012-07-31 15:59:36 -0700592 /**
Andrew Sapperstein17646052014-03-06 21:51:17 -0800593 * Integer column containing whether importance markers are enabled.
Vikram Aggarwal707f24c2012-07-31 15:59:36 -0700594 */
Andrew Sapperstein17646052014-03-06 21:51:17 -0800595 public static final String IMPORTANCE_MARKERS_ENABLED = "importance_markers_enabled";
596 /**
597 * Integer column containing whether chevrons should be shown.
598 * Chevrons are personal level indicators:
599 * an arrow ( › ) by messages sent to my address (not a mailing list),
600 * and a double arrow ( » ) by messages sent only to me.
601 */
602 public static final String SHOW_CHEVRONS_ENABLED = "show_chevrons_enabled";
Marc Blank57899082012-09-05 11:35:57 -0700603 /**
604 * Uri for EDIT intent that will cause account-specific setup UI to be shown. If not
605 * null, this intent should be used when an account is "entered" (i.e. viewing a folder
606 * in the account, etc.)
607 */
608 public static final String SETUP_INTENT_URI = "setup_intent_uri";
Paul Westbrookfa255c02012-10-13 14:32:52 -0700609 /**
Vikram Aggarwal69a6cdf2013-01-08 16:05:17 -0800610 * The regex that defines a veiled address, something that must be hidden from user
611 * view because it is temporary, long and clumsy.
612 */
Vikram Aggarwal6c3875a2013-01-15 16:00:11 -0800613 public static final String VEILED_ADDRESS_PATTERN = "veiled_address_pattern";
Vikram Aggarwal69a6cdf2013-01-08 16:05:17 -0800614 /**
Paul Westbrookfa255c02012-10-13 14:32:52 -0700615 * Integer column containing the Conversation view mode. This value will match one of
616 * constants from {@link ConversationViewMode}
617 */
618 public static final String CONVERSATION_VIEW_MODE = "conversation_view_mode";
Scott Kennedydd2ec682013-06-03 19:16:13 -0700619 /**
620 * String containing the URI for the inbox conversations should be moved to for this
621 * account.
622 */
623 public static final String MOVE_TO_INBOX = "move_to_inbox";
Alice Yangf323c042013-10-30 00:15:02 -0700624 /**
625 * Show images in conversation view.
626 */
627 public static final String SHOW_IMAGES = "show_images";
Paul Westbrookb1f573c2012-04-06 11:38:28 -0700628 }
Mindy Pereira3a565bf2011-12-21 11:26:21 -0800629 }
Paul Westbrook82ea6da2011-12-15 11:03:51 -0800630
Tony Mantler59e69092013-08-14 11:05:00 -0700631 public static final String[] QUICK_RESPONSE_PROJECTION = {
632 BaseColumns._ID,
633 QuickResponseColumns.TEXT,
634 QuickResponseColumns.URI
635 };
636
637 public static final class QuickResponseColumns {
638 /**
639 * Text of the Quick Response
640 */
641 public static final String TEXT = "quickResponse";
642 /**
643 * URI to access this row directly
644 */
645 public static final String URI = "uri";
646 }
647
Paul Westbrookb8361c92012-09-27 10:57:14 -0700648 public static final String[] ACCOUNT_COOKIE_PROJECTION = {
649 AccountCookieColumns.COOKIE
650 };
651
652 public static final class AccountCookieColumns {
653 /**
654 * String column containing the cookie string for this account.
655 */
656 public static final String COOKIE = "cookie";
657 }
658
Paul Westbrook8130e6f2012-03-06 13:51:01 -0800659 public static final class SearchQueryParameters {
660 /**
661 * Parameter used to specify the search query.
662 */
663 public static final String QUERY = "query";
664
Paul Westbrook8130e6f2012-03-06 13:51:01 -0800665 private SearchQueryParameters() {}
666 }
667
Marc Blank51144942012-03-20 13:59:32 -0700668 public static final class ConversationListQueryParameters {
669 public static final String DEFAULT_LIMIT = "50";
670 /**
671 * Parameter used to limit the number of rows returned by a conversation list query
672 */
673 public static final String LIMIT = "limit";
674
Paul Westbrook5f2876a2012-03-20 18:47:22 -0700675 /**
676 * Parameter used to control whether the this query a remote server.
677 */
678 public static final String USE_NETWORK = "use_network";
679
Paul Westbrook4880b5d2012-07-24 09:10:25 -0700680 /**
681 * Parameter used to allow the caller to indicate desire to receive all notifications.
682 * (Including ones for user initiated actions)
683 */
684 public static final String ALL_NOTIFICATIONS = "all_notifications";
685
Marc Blank51144942012-03-20 13:59:32 -0700686 private ConversationListQueryParameters() {}
687 }
688
Mindy Pereira3a565bf2011-12-21 11:26:21 -0800689 // We define a "folder" as anything that contains a list of conversations.
690 public static final String FOLDER_LIST_TYPE =
691 "vnd.android.cursor.dir/vnd.com.android.mail.folder";
692 public static final String FOLDER_TYPE =
Mindy Pereira750cc732011-12-21 13:32:29 -0800693 "vnd.android.cursor.item/vnd.com.android.mail.folder";
Mindy Pereira3a565bf2011-12-21 11:26:21 -0800694
695 public static final String[] FOLDERS_PROJECTION = {
Tony Mantler70147a92013-10-14 16:34:45 -0700696 FolderColumns._ID,
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800697 FolderColumns.PERSISTENT_ID,
Mindy Pereira6349a042012-01-04 11:25:01 -0800698 FolderColumns.URI,
Mindy Pereira3a565bf2011-12-21 11:26:21 -0800699 FolderColumns.NAME,
Mindy Pereira750cc732011-12-21 13:32:29 -0800700 FolderColumns.HAS_CHILDREN,
Mindy Pereira0973b202011-12-21 15:48:12 -0800701 FolderColumns.CAPABILITIES,
Mindy Pereira0973b202011-12-21 15:48:12 -0800702 FolderColumns.SYNC_WINDOW,
Mindy Pereira750cc732011-12-21 13:32:29 -0800703 FolderColumns.CONVERSATION_LIST_URI,
Mindy Pereirabd8f51c2012-01-06 13:41:48 -0800704 FolderColumns.CHILD_FOLDERS_LIST_URI,
Scott Kennedy61bd0e82012-12-10 18:18:17 -0800705 FolderColumns.UNSEEN_COUNT,
Mindy Pereirabd8f51c2012-01-06 13:41:48 -0800706 FolderColumns.UNREAD_COUNT,
Marc Blankc8a99422012-01-19 14:27:47 -0800707 FolderColumns.TOTAL_COUNT,
Mindy Pereira77528642012-02-17 15:51:10 -0800708 FolderColumns.REFRESH_URI,
Marc Blank9ace18a2012-02-21 16:34:07 -0800709 FolderColumns.SYNC_STATUS,
Mindy Pereira78664722012-03-05 13:53:07 -0800710 FolderColumns.LAST_SYNC_RESULT,
711 FolderColumns.TYPE,
Mindy Pereira9275a062012-03-08 15:12:14 -0800712 FolderColumns.ICON_RES_ID,
Scott Kennedy61bd0e82012-12-10 18:18:17 -0800713 FolderColumns.NOTIFICATION_ICON_RES_ID,
Mindy Pereira9275a062012-03-08 15:12:14 -0800714 FolderColumns.BG_COLOR,
Marc Blank48a4aed2012-03-10 14:07:00 -0800715 FolderColumns.FG_COLOR,
Mindy Pereirac1e87902012-06-26 11:51:41 -0700716 FolderColumns.LOAD_MORE_URI,
Scott Kennedy7c8325d2013-02-28 10:46:10 -0800717 FolderColumns.HIERARCHICAL_DESC,
Vikram Aggarwala3bbac02013-07-03 15:53:44 -0700718 FolderColumns.LAST_MESSAGE_TIMESTAMP,
719 FolderColumns.PARENT_URI
Mindy Pereira3a565bf2011-12-21 11:26:21 -0800720 };
721
Tony Mantler42fe4862013-10-23 11:39:19 -0700722 public static final String[] FOLDERS_PROJECTION_WITH_UNREAD_SENDERS =
723 (new ImmutableList.Builder<String>()
724 .addAll(ImmutableList.copyOf(FOLDERS_PROJECTION))
725 .add(FolderColumns.UNREAD_SENDERS)
726 .build().toArray(new String[0]));
727
Mindy Pereira7e5de7a2012-03-13 15:36:03 -0700728 public static final int FOLDER_ID_COLUMN = 0;
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800729 public static final int FOLDER_PERSISTENT_ID_COLUMN = 1;
730 public static final int FOLDER_URI_COLUMN = 2;
731 public static final int FOLDER_NAME_COLUMN = 3;
732 public static final int FOLDER_HAS_CHILDREN_COLUMN = 4;
733 public static final int FOLDER_CAPABILITIES_COLUMN = 5;
734 public static final int FOLDER_SYNC_WINDOW_COLUMN = 6;
735 public static final int FOLDER_CONVERSATION_LIST_URI_COLUMN = 7;
736 public static final int FOLDER_CHILD_FOLDERS_LIST_COLUMN = 8;
Scott Kennedy61bd0e82012-12-10 18:18:17 -0800737 public static final int FOLDER_UNSEEN_COUNT_COLUMN = 9;
738 public static final int FOLDER_UNREAD_COUNT_COLUMN = 10;
739 public static final int FOLDER_TOTAL_COUNT_COLUMN = 11;
740 public static final int FOLDER_REFRESH_URI_COLUMN = 12;
741 public static final int FOLDER_SYNC_STATUS_COLUMN = 13;
742 public static final int FOLDER_LAST_SYNC_RESULT_COLUMN = 14;
743 public static final int FOLDER_TYPE_COLUMN = 15;
744 public static final int FOLDER_ICON_RES_ID_COLUMN = 16;
745 public static final int FOLDER_NOTIFICATION_ICON_RES_ID_COLUMN = 17;
746 public static final int FOLDER_BG_COLOR_COLUMN = 18;
747 public static final int FOLDER_FG_COLOR_COLUMN = 19;
748 public static final int FOLDER_LOAD_MORE_URI_COLUMN = 20;
749 public static final int FOLDER_HIERARCHICAL_DESC_COLUMN = 21;
Scott Kennedy7c8325d2013-02-28 10:46:10 -0800750 public static final int FOLDER_LAST_MESSAGE_TIMESTAMP_COLUMN = 22;
Vikram Aggarwala3bbac02013-07-03 15:53:44 -0700751 public static final int FOLDER_PARENT_URI_COLUMN = 23;
Mindy Pereira78664722012-03-05 13:53:07 -0800752
753 public static final class FolderType {
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700754 /** A user defined label. */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700755 public static final int DEFAULT = 1 << 0;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700756 /** A system defined inbox */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700757 public static final int INBOX = 1 << 1;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700758 /** A system defined containing mails to be edited before sending. */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700759 public static final int DRAFT = 1 << 2;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700760 /** A system defined folder containing mails <b>to be</b> sent */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700761 public static final int OUTBOX = 1 << 3;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700762 /** A system defined folder containing sent mails */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700763 public static final int SENT = 1 << 4;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700764 /** A system defined trash folder */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700765 public static final int TRASH = 1 << 5;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700766 /** A system defined spam folder */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700767 public static final int SPAM = 1 << 6;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700768 /** A system defined starred folder */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700769 public static final int STARRED = 1 << 7;
Vikram Aggarwal58cad2e2012-08-28 16:18:23 -0700770 /** Any other system label that we do not have a specific name for. */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700771 public static final int OTHER_PROVIDER_FOLDER = 1 << 8;
Scott Kennedydd2ec682013-06-03 19:16:13 -0700772 /** All mail folder */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700773 public static final int ALL_MAIL = 1 << 9;
Scott Kennedydd2ec682013-06-03 19:16:13 -0700774 /** Gmail's inbox sections */
Scott Kennedy8c1058e2013-03-20 13:40:20 -0700775 public static final int INBOX_SECTION = 1 << 10;
Andrew Sappersteine58a66c2013-06-26 16:27:02 -0700776 /** A system defined unread folder */
777 public static final int UNREAD = 1 << 11;
Scott Kennedya158ac82013-09-04 13:48:13 -0700778 /** A "fake" search folder */
779 public static final int SEARCH = 1 << 12;
Mindy Pereira78664722012-03-05 13:53:07 -0800780 }
Mindy Pereira818143e2012-01-11 13:59:49 -0800781
Mindy Pereira0973b202011-12-21 15:48:12 -0800782 public static final class FolderCapabilities {
783 public static final int SYNCABLE = 0x0001;
784 public static final int PARENT = 0x0002;
Andrew Sappersteinf33d7d42013-09-03 15:11:25 -0700785 // FEEL FREE TO USE 0x0004 - was previous CAN_HOLD_MAIL but that was true for all
786 // folders so we removed that value
Mindy Pereira0973b202011-12-21 15:48:12 -0800787 public static final int CAN_ACCEPT_MOVED_MESSAGES = 0x0008;
Marc Blanka8352052012-04-04 11:37:48 -0700788 /**
Paul Westbrook334e64a2012-02-23 13:26:35 -0800789 * For accounts that support archive, this will indicate that this folder supports
790 * the archive functionality.
791 */
792 public static final int ARCHIVE = 0x0010;
793
794 /**
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700795 * This will indicated that this folder supports the delete functionality.
796 */
797 public static final int DELETE = 0x0020;
798
799 /**
Paul Westbrook334e64a2012-02-23 13:26:35 -0800800 * For accounts that support report spam, this will indicate that this folder supports
801 * the report spam functionality.
802 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700803 public static final int REPORT_SPAM = 0x0040;
Paul Westbrook334e64a2012-02-23 13:26:35 -0800804
805 /**
Paul Westbrook77eee622012-07-10 13:41:57 -0700806 * For accounts that support report spam, this will indicate that this folder supports
Paul Westbrook76b20622012-07-12 11:45:43 -0700807 * the mark not spam functionality.
Paul Westbrook77eee622012-07-10 13:41:57 -0700808 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700809 public static final int MARK_NOT_SPAM = 0x0080;
Paul Westbrook77eee622012-07-10 13:41:57 -0700810
811 /**
Paul Westbrook334e64a2012-02-23 13:26:35 -0800812 * For accounts that support mute, this will indicate if a mute is performed from within
813 * this folder, the action is destructive.
814 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700815 public static final int DESTRUCTIVE_MUTE = 0x0100;
Marc Blanka8352052012-04-04 11:37:48 -0700816
817 /**
818 * Indicates that a folder supports settings (sync lookback, etc.)
819 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700820 public static final int SUPPORTS_SETTINGS = 0x0200;
Vikram Aggarwal04dc8192012-04-09 13:07:19 -0700821 /**
822 * All the messages in this folder are important.
823 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700824 public static final int ONLY_IMPORTANT = 0x0400;
Marc Blank386243f2012-05-25 10:40:59 -0700825 /**
826 * Deletions in this folder can't be undone (could include archive if desirable)
827 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700828 public static final int DELETE_ACTION_FINAL = 0x0800;
Marc Blanka6b671d2012-05-25 12:52:02 -0700829 /**
830 * This folder is virtual, i.e. contains conversations potentially pulled from other
831 * folders, potentially even from different accounts. Examples might be a "starred"
832 * folder, or an "unread" folder (per account or provider-wide)
833 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700834 public static final int IS_VIRTUAL = 0x1000;
Paul Westbrook76b20622012-07-12 11:45:43 -0700835
836 /**
837 * For accounts that support report phishing, this will indicate that this folder supports
838 * the report phishing functionality.
839 */
Paul Westbrook6102c7d2012-08-19 13:20:24 -0700840 public static final int REPORT_PHISHING = 0x2000;
Rohan Shah6f95dd22013-02-08 10:13:52 -0800841
842 /**
843 * The flag indicates that the user has the ability to move conversations
844 * from this folder.
845 */
846 public static final int ALLOWS_REMOVE_CONVERSATION = 0x4000;
Scott Kennedye7e01632013-04-25 17:08:53 -0700847
848 /**
849 * The flag indicates that the user has the ability to move conversations to or from this
850 * Folder in the same operation as other Folder changes (usually through
Scott Kennedyd3728042013-04-25 20:23:10 -0700851 * {@link com.android.mail.ui.MultiFoldersSelectionDialog}).
Scott Kennedye7e01632013-04-25 17:08:53 -0700852 */
853 public static final int MULTI_MOVE = 0x8000;
Scott Kennedydd2ec682013-06-03 19:16:13 -0700854
855 /**
856 * This flag indicates that a conversation may be moved from this folder into the account's
857 * inbox.
858 */
859 public static final int ALLOWS_MOVE_TO_INBOX = 0x10000;
James Lemieux10ea28a2014-03-27 14:33:58 -0700860
861 /**
862 * For folders that typically represent outgoing mail, this indicates the client should
863 * display recipients rather than the standard list of senders.
864 */
865 public static final int SHOW_RECIPIENTS = 0x20000;
Mindy Pereira0973b202011-12-21 15:48:12 -0800866 }
867
Tony Mantler70147a92013-10-14 16:34:45 -0700868 public static final class FolderColumns implements BaseColumns {
Paul Westbrook0b63e8d2012-03-13 11:52:42 -0700869 /**
Scott Kennedyd5edd2d2012-12-05 11:11:32 -0800870 * This string column contains an id for the folder that is constant across devices, or
871 * null if there is no constant id.
872 */
873 public static final String PERSISTENT_ID = "persistentId";
874 /**
Paul Westbrook0b63e8d2012-03-13 11:52:42 -0700875 * This string column contains the uri of the folder.
876 */
Mindy Pereira77528642012-02-17 15:51:10 -0800877 public static final String URI = "folderUri";
Mindy Pereira3a565bf2011-12-21 11:26:21 -0800878 /**
879 * This string column contains the human visible name for the folder.
880 */
881 public static final String NAME = "name";
882 /**
Mindy Pereira0973b202011-12-21 15:48:12 -0800883 * This int column represents the capabilities of the folder specified by
884 * FolderCapabilities flags.
885 */
Paul Westbrookb8911732013-04-28 11:54:49 -0700886 public static final String CAPABILITIES = "capabilities";
Mindy Pereira0973b202011-12-21 15:48:12 -0800887 /**
Mindy Pereirafc2277e2012-01-11 10:23:44 -0800888 * This int column represents whether or not this folder has any
Mindy Pereira750cc732011-12-21 13:32:29 -0800889 * child folders.
890 */
Paul Westbrookb8911732013-04-28 11:54:49 -0700891 public static final String HAS_CHILDREN = "hasChildren";
Mindy Pereira750cc732011-12-21 13:32:29 -0800892 /**
Mindy Pereira0973b202011-12-21 15:48:12 -0800893 * This int column represents how large the sync window is.
894 */
Paul Westbrookb8911732013-04-28 11:54:49 -0700895 public static final String SYNC_WINDOW = "syncWindow";
Mindy Pereira0973b202011-12-21 15:48:12 -0800896 /**
Mindy Pereira750cc732011-12-21 13:32:29 -0800897 * This string column contains the content provider uri to return the
898 * list of conversations for this folder.
Mindy Pereira3a565bf2011-12-21 11:26:21 -0800899 */
900 public static final String CONVERSATION_LIST_URI = "conversationListUri";
Mindy Pereira750cc732011-12-21 13:32:29 -0800901 /**
902 * This string column contains the content provider uri to return the
903 * list of child folders of this folder.
904 */
Mindy Pereira77528642012-02-17 15:51:10 -0800905 public static final String CHILD_FOLDERS_LIST_URI = "childFoldersListUri";
Scott Kennedy61bd0e82012-12-10 18:18:17 -0800906 /**
907 * This int column contains the current unseen count for the folder, if known.
908 */
909 public static final String UNSEEN_COUNT = "unseenCount";
910 /**
911 * This int column contains the current unread count for the folder.
912 */
Mindy Pereira77528642012-02-17 15:51:10 -0800913 public static final String UNREAD_COUNT = "unreadCount";
Mindy Pereirabd8f51c2012-01-06 13:41:48 -0800914
Mindy Pereira77528642012-02-17 15:51:10 -0800915 public static final String TOTAL_COUNT = "totalCount";
Mindy Pereira9c002102012-02-17 14:45:58 -0800916 /**
917 * This string column contains the content provider uri to force a
918 * refresh of this folder.
919 */
Mindy Pereira77528642012-02-17 15:51:10 -0800920 public static final String REFRESH_URI = "refreshUri";
921 /**
Marc Blank9ace18a2012-02-21 16:34:07 -0800922 * This int column contains current sync status of the folder; some combination of the
923 * SyncStatus bits defined above
Mindy Pereira77528642012-02-17 15:51:10 -0800924 */
Marc Blank9ace18a2012-02-21 16:34:07 -0800925 public static final String SYNC_STATUS = "syncStatus";
926 /**
927 * This int column contains the sync status of the last sync attempt; one of the
928 * LastSyncStatus values defined above
929 */
930 public static final String LAST_SYNC_RESULT = "lastSyncResult";
Mindy Pereira78664722012-03-05 13:53:07 -0800931 /**
Scott Kennedy61bd0e82012-12-10 18:18:17 -0800932 * This int column contains the icon res id for this folder, or 0 if there is none.
Mindy Pereira78664722012-03-05 13:53:07 -0800933 */
934 public static final String ICON_RES_ID = "iconResId";
935 /**
Scott Kennedy61bd0e82012-12-10 18:18:17 -0800936 * This int column contains the notification icon res id for this folder, or 0 if there is
937 * none.
938 */
939 public static final String NOTIFICATION_ICON_RES_ID = "notificationIconResId";
940 /**
Mindy Pereira78664722012-03-05 13:53:07 -0800941 * This int column contains the type of the folder. Zero is default.
942 */
943 public static final String TYPE = "type";
Mindy Pereira9275a062012-03-08 15:12:14 -0800944 /**
945 * String representing the integer background color associated with this
946 * folder, or null.
947 */
948 public static final String BG_COLOR = "bgColor";
949 /**
950 * String representing the integer of the foreground color associated
951 * with this folder, or null.
952 */
953 public static final String FG_COLOR = "fgColor";
Marc Blank48a4aed2012-03-10 14:07:00 -0800954 /**
955 * String with the content provider Uri used to request more items in the folder, or null.
956 */
957 public static final String LOAD_MORE_URI = "loadMoreUri";
Vikram Aggarwal27d89ad2012-06-12 13:38:40 -0700958
Mindy Pereirac1e87902012-06-26 11:51:41 -0700959 /**
960 * Possibly empty string that describes the full hierarchy of a folder
961 * along with its name.
962 */
963 public static final String HIERARCHICAL_DESC = "hierarchicalDesc";
964
Scott Kennedy7c8325d2013-02-28 10:46:10 -0800965 /**
966 * The timestamp of the last message received in this folder.
967 */
968 public static final String LAST_MESSAGE_TIMESTAMP = "lastMessageTimestamp";
969
Vikram Aggarwala3bbac02013-07-03 15:53:44 -0700970 /**
971 * The URI, possibly null, of the parent folder.
972 */
973 public static final String PARENT_URI = "parentUri";
974
Tony Mantler42fe4862013-10-23 11:39:19 -0700975 /**
976 * A string of unread senders sorted by date, so we don't have to fetch this in multiple
977 * queries
978 */
979 public static final String UNREAD_SENDERS = "unreadSenders";
980
Vikram Aggarwalff7d02a2012-01-11 16:37:45 -0800981 public FolderColumns() {}
Mindy Pereira6f92de62011-12-19 11:31:48 -0800982 }
983
Mindy Pereiraa1406072011-12-22 10:54:06 -0800984 // We define a "folder" as anything that contains a list of conversations.
985 public static final String CONVERSATION_LIST_TYPE =
986 "vnd.android.cursor.dir/vnd.com.android.mail.conversation";
987 public static final String CONVERSATION_TYPE =
988 "vnd.android.cursor.item/vnd.com.android.mail.conversation";
989
Mindy Pereira9cdc4062012-02-02 14:18:08 -0800990
Mindy Pereiraa1406072011-12-22 10:54:06 -0800991 public static final String[] CONVERSATION_PROJECTION = {
992 BaseColumns._ID,
Mindy Pereira6349a042012-01-04 11:25:01 -0800993 ConversationColumns.URI,
Mindy Pereiraf9573c52011-12-22 14:02:49 -0800994 ConversationColumns.MESSAGE_LIST_URI,
Mindy Pereiraa1406072011-12-22 10:54:06 -0800995 ConversationColumns.SUBJECT,
Mindy Pereiraf9573c52011-12-22 14:02:49 -0800996 ConversationColumns.SNIPPET,
Mindy Pereira648df3f2012-07-19 09:20:26 -0700997 ConversationColumns.CONVERSATION_INFO,
Mindy Pereiraf30cc092011-12-29 14:02:40 -0800998 ConversationColumns.DATE_RECEIVED_MS,
Mindy Pereira4db59c52012-01-12 09:45:13 -0800999 ConversationColumns.HAS_ATTACHMENTS,
1000 ConversationColumns.NUM_MESSAGES,
1001 ConversationColumns.NUM_DRAFTS,
1002 ConversationColumns.SENDING_STATE,
Marc Blankc8a99422012-01-19 14:27:47 -08001003 ConversationColumns.PRIORITY,
1004 ConversationColumns.READ,
Scott Kennedyd5edd2d2012-12-05 11:11:32 -08001005 ConversationColumns.SEEN,
Mindy Pereira36b6c8b2012-02-03 14:16:07 -08001006 ConversationColumns.STARRED,
Mindy Pereira22657522012-03-14 13:27:59 -07001007 ConversationColumns.RAW_FOLDERS,
1008 ConversationColumns.FLAGS,
Mindy Pereira87d535f2012-03-23 11:15:56 -07001009 ConversationColumns.PERSONAL_LEVEL,
1010 ConversationColumns.SPAM,
Paul Westbrook76b20622012-07-12 11:45:43 -07001011 ConversationColumns.PHISHING,
Marc Blank92939fc2012-04-30 14:58:40 -07001012 ConversationColumns.MUTED,
Marc Blanka6b671d2012-05-25 12:52:02 -07001013 ConversationColumns.COLOR,
Mindy Pereira648df3f2012-07-19 09:20:26 -07001014 ConversationColumns.ACCOUNT_URI,
Paul Westbrook41dca182012-08-07 10:43:42 -07001015 ConversationColumns.SENDER_INFO,
Andy Huangf98bc892012-08-07 18:22:09 -07001016 ConversationColumns.CONVERSATION_BASE_URI,
Mark Wei479505d2013-03-21 06:04:46 -07001017 ConversationColumns.REMOTE,
1018 ConversationColumns.ATTACHMENT_PREVIEW_URI0,
1019 ConversationColumns.ATTACHMENT_PREVIEW_URI1,
1020 ConversationColumns.ATTACHMENT_PREVIEW_STATES,
Andrew Sapperstein20c20822014-04-16 11:47:19 -07001021 ConversationColumns.ATTACHMENT_PREVIEWS_COUNT
Mindy Pereiraa1406072011-12-22 10:54:06 -08001022 };
1023
Paul Westbrook5bb0f802013-06-06 10:01:15 -07001024 /**
1025 * This integer corresponds to the number of rows of queries that specify the
1026 * {@link UIProvider#CONVERSATION_PROJECTION} projection will fit in a single
1027 * {@link android.database.CursorWindow}
1028 */
Tony Mantler84a21ce2014-01-03 15:43:35 -08001029 public static final int CONVERSATION_PROJECTION_QUERY_CURSOR_WINDOW_LIMIT = 1500;
Paul Westbrook5bb0f802013-06-06 10:01:15 -07001030
Mindy Pereirafdd984b2011-12-29 09:43:45 -08001031 // These column indexes only work when the caller uses the
1032 // default CONVERSATION_PROJECTION defined above.
Mindy Pereirafa7ef6e2011-12-29 14:18:15 -08001033 public static final int CONVERSATION_ID_COLUMN = 0;
Mindy Pereira3263fa92012-01-04 10:15:32 -08001034 public static final int CONVERSATION_URI_COLUMN = 1;
1035 public static final int CONVERSATION_MESSAGE_LIST_URI_COLUMN = 2;
1036 public static final int CONVERSATION_SUBJECT_COLUMN = 3;
1037 public static final int CONVERSATION_SNIPPET_COLUMN = 4;
Mindy Pereira648df3f2012-07-19 09:20:26 -07001038 public static final int CONVERSATION_INFO_COLUMN = 5;
Mindy Pereira3263fa92012-01-04 10:15:32 -08001039 public static final int CONVERSATION_DATE_RECEIVED_MS_COLUMN = 6;
1040 public static final int CONVERSATION_HAS_ATTACHMENTS_COLUMN = 7;
Mindy Pereira4db59c52012-01-12 09:45:13 -08001041 public static final int CONVERSATION_NUM_MESSAGES_COLUMN = 8;
1042 public static final int CONVERSATION_NUM_DRAFTS_COLUMN = 9;
1043 public static final int CONVERSATION_SENDING_STATE_COLUMN = 10;
1044 public static final int CONVERSATION_PRIORITY_COLUMN = 11;
Marc Blankc8a99422012-01-19 14:27:47 -08001045 public static final int CONVERSATION_READ_COLUMN = 12;
Scott Kennedyd5edd2d2012-12-05 11:11:32 -08001046 public static final int CONVERSATION_SEEN_COLUMN = 13;
1047 public static final int CONVERSATION_STARRED_COLUMN = 14;
1048 public static final int CONVERSATION_RAW_FOLDERS_COLUMN = 15;
1049 public static final int CONVERSATION_FLAGS_COLUMN = 16;
1050 public static final int CONVERSATION_PERSONAL_LEVEL_COLUMN = 17;
1051 public static final int CONVERSATION_IS_SPAM_COLUMN = 18;
1052 public static final int CONVERSATION_IS_PHISHING_COLUMN = 19;
1053 public static final int CONVERSATION_MUTED_COLUMN = 20;
1054 public static final int CONVERSATION_COLOR_COLUMN = 21;
1055 public static final int CONVERSATION_ACCOUNT_URI_COLUMN = 22;
1056 public static final int CONVERSATION_SENDER_INFO_COLUMN = 23;
1057 public static final int CONVERSATION_BASE_URI_COLUMN = 24;
1058 public static final int CONVERSATION_REMOTE_COLUMN = 25;
Mark Wei479505d2013-03-21 06:04:46 -07001059 public static final int CONVERSATION_ATTACHMENT_PREVIEW_URI0_COLUMN = 26;
1060 public static final int CONVERSATION_ATTACHMENT_PREVIEW_URI1_COLUMN = 27;
1061 public static final int CONVERSATION_ATTACHMENT_PREVIEW_STATES_COLUMN = 28;
1062 public static final int CONVERSATION_ATTACHMENT_PREVIEWS_COUNT_COLUMN = 29;
Mindy Pereira4db59c52012-01-12 09:45:13 -08001063
1064 public static final class ConversationSendingState {
Mindy Pereiraa4571372012-01-12 14:04:21 -08001065 public static final int OTHER = 0;
Paul Westbrook2c636302012-08-03 10:12:41 -07001066 public static final int QUEUED = 1;
1067 public static final int SENDING = 2;
1068 public static final int SENT = 3;
Mindy Pereira4db59c52012-01-12 09:45:13 -08001069 public static final int SEND_ERROR = -1;
Vikram Aggarwal859681b2012-02-03 10:02:24 -08001070 }
Mindy Pereira4db59c52012-01-12 09:45:13 -08001071
1072 public static final class ConversationPriority {
Mindy Pereira22657522012-03-14 13:27:59 -07001073 public static final int DEFAULT = 0;
1074 public static final int IMPORTANT = 1;
Mindy Pereira4db59c52012-01-12 09:45:13 -08001075 public static final int LOW = 0;
1076 public static final int HIGH = 1;
Vikram Aggarwal859681b2012-02-03 10:02:24 -08001077 }
Mindy Pereirafa7ef6e2011-12-29 14:18:15 -08001078
Mindy Pereira22657522012-03-14 13:27:59 -07001079 public static final class ConversationPersonalLevel {
1080 public static final int NOT_TO_ME = 0;
1081 public static final int TO_ME_AND_OTHERS = 1;
1082 public static final int ONLY_TO_ME = 2;
1083 }
1084
Marc Blankc8a99422012-01-19 14:27:47 -08001085 public static final class ConversationFlags {
Marc Blankc8a99422012-01-19 14:27:47 -08001086 public static final int REPLIED = 1<<2;
1087 public static final int FORWARDED = 1<<3;
Mindy Pereirad69f5ad2012-03-14 13:20:24 -07001088 public static final int CALENDAR_INVITE = 1<<4;
Vikram Aggarwal859681b2012-02-03 10:02:24 -08001089 }
Marc Blankc8a99422012-01-19 14:27:47 -08001090
Paul Westbrook76b20622012-07-12 11:45:43 -07001091 public static final class ConversationPhishing {
1092 public static final int NOT_PHISHING = 0;
1093 public static final int PHISHING = 1;
1094 }
1095
Vikram Aggarwal531488e2012-05-29 16:36:52 -07001096 /**
1097 * Names of columns representing fields in a Conversation.
1098 */
Mindy Pereiraa1406072011-12-22 10:54:06 -08001099 public static final class ConversationColumns {
Mindy Pereira6349a042012-01-04 11:25:01 -08001100 public static final String URI = "conversationUri";
Mindy Pereiraa1406072011-12-22 10:54:06 -08001101 /**
Mindy Pereiraa1406072011-12-22 10:54:06 -08001102 * This string column contains the content provider uri to return the
1103 * list of messages for this conversation.
Paul Westbrook9cf43892012-03-15 15:43:47 -07001104 * The cursor returned by this query can return a {@link android.os.Bundle}
1105 * from a call to {@link android.database.Cursor#getExtras()}. This Bundle may have
1106 * values with keys listed in {@link CursorExtraKeys}
Mindy Pereiraa1406072011-12-22 10:54:06 -08001107 */
1108 public static final String MESSAGE_LIST_URI = "messageListUri";
Mindy Pereira27a0cf02011-12-22 13:16:32 -08001109 /**
1110 * This string column contains the subject string for a conversation.
1111 */
1112 public static final String SUBJECT = "subject";
1113 /**
1114 * This string column contains the snippet string for a conversation.
1115 */
1116 public static final String SNIPPET = "snippet";
1117 /**
Mindy Pereira648df3f2012-07-19 09:20:26 -07001118 * @deprecated
Mindy Pereira27a0cf02011-12-22 13:16:32 -08001119 */
Mark Weif6fac0a2013-02-11 20:58:17 -08001120 @Deprecated
Mindy Pereira27a0cf02011-12-22 13:16:32 -08001121 public static final String SENDER_INFO = "senderInfo";
1122 /**
Andy Huang351ad4e2012-12-06 16:04:58 -08001123 * This blob column contains the byte-array representation of the Parceled
1124 * ConversationInfo object for a conversation.
Andy Huang7f39bbd2013-05-20 20:36:38 -07001125 *
1126 * @deprecated providers should implement
1127 * {@link ConversationCursorCommand#COMMAND_GET_CONVERSATION_INFO} instead.
Mindy Pereira648df3f2012-07-19 09:20:26 -07001128 */
Andy Huang7f39bbd2013-05-20 20:36:38 -07001129 @Deprecated
Mindy Pereira648df3f2012-07-19 09:20:26 -07001130 public static final String CONVERSATION_INFO = "conversationInfo";
1131 /**
Mindy Pereira27a0cf02011-12-22 13:16:32 -08001132 * This long column contains the time in ms of the latest update to a
1133 * conversation.
1134 */
1135 public static final String DATE_RECEIVED_MS = "dateReceivedMs";
1136
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001137 /**
1138 * This boolean column contains whether any messages in this conversation
1139 * have attachments.
1140 */
1141 public static final String HAS_ATTACHMENTS = "hasAttachments";
1142
Mindy Pereira4db59c52012-01-12 09:45:13 -08001143 /**
1144 * This int column contains the number of messages in this conversation.
1145 * For unthreaded, this will always be 1.
1146 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001147 public static final String NUM_MESSAGES = "numMessages";
Mindy Pereira4db59c52012-01-12 09:45:13 -08001148
1149 /**
1150 * This int column contains the number of drafts associated with this
1151 * conversation.
1152 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001153 public static final String NUM_DRAFTS = "numDrafts";
Mindy Pereira4db59c52012-01-12 09:45:13 -08001154
1155 /**
1156 * This int column contains the state of drafts and replies associated
1157 * with this conversation. Use ConversationSendingState to interpret
1158 * this field.
1159 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001160 public static final String SENDING_STATE = "sendingState";
Mindy Pereira4db59c52012-01-12 09:45:13 -08001161
1162 /**
1163 * This int column contains the priority of this conversation. Use
1164 * ConversationPriority to interpret this field.
1165 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001166 public static final String PRIORITY = "priority";
Mindy Pereira4db59c52012-01-12 09:45:13 -08001167
Marc Blankc8a99422012-01-19 14:27:47 -08001168 /**
Mindy Pereira87d535f2012-03-23 11:15:56 -07001169 * This int column indicates whether the conversation has been read
Marc Blankc8a99422012-01-19 14:27:47 -08001170 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001171 public static final String READ = "read";
Scott Kennedyd5edd2d2012-12-05 11:11:32 -08001172
1173 /**
1174 * This int column indicates whether the conversation has been seen
1175 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001176 public static final String SEEN = "seen";
Scott Kennedyd5edd2d2012-12-05 11:11:32 -08001177
Marc Blankc8a99422012-01-19 14:27:47 -08001178 /**
Mindy Pereira87d535f2012-03-23 11:15:56 -07001179 * This int column indicates whether the conversation has been starred
Marc Blankc8a99422012-01-19 14:27:47 -08001180 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001181 public static final String STARRED = "starred";
Marc Blankc8a99422012-01-19 14:27:47 -08001182
Mindy Pereira36b6c8b2012-02-03 14:16:07 -08001183 /**
Andy Huangb2033d82012-12-07 19:30:57 -08001184 * This blob column contains the marshalled form of a Parceled
1185 * {@FolderList} object. Ideally, only ever use this for
1186 * rendering the folder list for a conversation.
Andy Huang7f39bbd2013-05-20 20:36:38 -07001187 *
1188 * @deprecated providers should implement
1189 * {@link ConversationCursorCommand#COMMAND_GET_RAW_FOLDERS} instead.
Mindy Pereiracc8211d2012-03-12 10:35:37 -07001190 */
Andy Huang7f39bbd2013-05-20 20:36:38 -07001191 @Deprecated
Mindy Pereira183718b2012-03-12 11:00:14 -07001192 public static final String RAW_FOLDERS = "rawFolders";
Mindy Pereira22657522012-03-14 13:27:59 -07001193 public static final String FLAGS = "conversationFlags";
Andy Huang1284fd62012-07-12 16:48:06 -07001194 /**
1195 * This int column indicates the personal level of a conversation per
1196 * {@link ConversationPersonalLevel}.
1197 */
Mindy Pereira22657522012-03-14 13:27:59 -07001198 public static final String PERSONAL_LEVEL = "personalLevel";
Mindy Pereira87d535f2012-03-23 11:15:56 -07001199
1200 /**
1201 * This int column indicates whether the conversation is marked spam.
1202 */
1203 public static final String SPAM = "spam";
1204
1205 /**
Paul Westbrook76b20622012-07-12 11:45:43 -07001206 * This int column indicates whether the conversation is marked phishing.
1207 */
1208 public static final String PHISHING = "phishing";
1209
1210 /**
Mindy Pereira87d535f2012-03-23 11:15:56 -07001211 * This int column indicates whether the conversation was muted.
1212 */
1213 public static final String MUTED = "muted";
1214
Marc Blank92939fc2012-04-30 14:58:40 -07001215 /**
1216 * This int column contains a color for the conversation (used in Email only)
1217 */
1218 public static final String COLOR = "color";
1219
Marc Blanka6b671d2012-05-25 12:52:02 -07001220 /**
1221 * This String column contains the Uri for this conversation's account
1222 */
1223 public static final String ACCOUNT_URI = "accountUri";
Vikram Aggarwal66bc2aa2012-08-02 10:47:03 -07001224 /**
Andy Huangf98bc892012-08-07 18:22:09 -07001225 * This int column indicates whether a conversation is remote (non-local), and would require
1226 * a network fetch to load.
1227 */
1228 public static final String REMOTE = "remote";
1229 /**
Vikram Aggarwal66bc2aa2012-08-02 10:47:03 -07001230 * This int column indicates whether the conversation was displayed on the UI and the
1231 * user got a chance to read it. The UI does not read this value, it is meant only to
1232 * write the status back to the provider. As a result, it is not available in the
1233 * {@link Conversation} object.
1234 */
Andy Huangf98bc892012-08-07 18:22:09 -07001235 public static final String VIEWED = "viewed";
Paul Westbrook41dca182012-08-07 10:43:42 -07001236 /**
1237 * This String column contains the base uri for this conversation. This uri can be used
1238 * when handling relative urls in the message content
1239 */
1240 public static final String CONVERSATION_BASE_URI = "conversationBaseUri";
1241
Mark Wei479505d2013-03-21 06:04:46 -07001242 /**
1243 * This string column contains the uri of the first attachment preview of the first unread
1244 * message, denoted by UNREAD_MESSAGE_ID.
1245 */
1246 public static final String ATTACHMENT_PREVIEW_URI0 = "attachmentPreviewUri0";
1247
1248 /**
1249 * This string column contains the uri of the second attachment preview of the first unread
1250 * message, denoted by UNREAD_MESSAGE_ID.
1251 */
1252 public static final String ATTACHMENT_PREVIEW_URI1 = "attachmentPreviewUri1";
1253
1254 /**
1255 * This int column contains the states of the attachment previews of the first unread
1256 * message, the same message used for the snippet. The states is a packed int,
1257 * where the first and second bits represent the SIMPLE and BEST state of the first
1258 * attachment preview, while the third and fourth bits represent those states for the
1259 * second attachment preview. For each bit, a one means that rendition of that attachment
1260 * preview is downloaded.
1261 */
1262 public static final String ATTACHMENT_PREVIEW_STATES = "attachmentPreviewStates";
1263
1264 /**
1265 * This int column contains the total count of images in the first unread message. The
1266 * total count may be higher than the number of ATTACHMENT_PREVIEW_URI columns.
1267 */
1268 public static final String ATTACHMENT_PREVIEWS_COUNT = "attachmentPreviewsCount";
1269
Paul Westbrook334e64a2012-02-23 13:26:35 -08001270 private ConversationColumns() {
Andy Huang732600e2012-01-10 17:47:17 -08001271 }
Mindy Pereiraa1406072011-12-22 10:54:06 -08001272 }
1273
Andy Huangca854412012-04-20 19:55:38 -07001274 public static final class ConversationCursorCommand {
1275
1276 public static final String COMMAND_RESPONSE_OK = "ok";
1277 public static final String COMMAND_RESPONSE_FAILED = "failed";
1278
1279 /**
Andy Huangd521baf2013-05-21 18:08:08 -07001280 * Incoming bundles may include this key with an Integer bitfield value. See below for bit
1281 * values.
1282 */
1283 public static final String COMMAND_KEY_OPTIONS = "options";
1284
1285 /**
1286 * Clients must set this bit when the {@link Cursor#respond(Bundle)} call is being used to
1287 * fetch a {@link Parcelable}. It serves as a hint that this call requires the cursor
1288 * position to first safely be moved.
1289 */
1290 public static final int OPTION_MOVE_POSITION = 0x01;
1291
1292 /**
Paul Westbrook9f119c72012-04-24 16:10:59 -07001293 * This bundle key has a boolean value: true to indicate that this cursor has been shown
1294 * to the user.
Vikram Aggarwal69b5c302012-09-05 11:11:13 -07001295 * <p>
1296 * A provider that implements this command should include this key in its response with a
1297 * value of {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}.
Paul Westbrook9f119c72012-04-24 16:10:59 -07001298 */
1299 public static final String COMMAND_KEY_SET_VISIBILITY = "setVisibility";
1300
Vikram Aggarwal69b5c302012-09-05 11:11:13 -07001301 /**
1302 * This key has a boolean value: true to indicate that this folder list is shown to the user
1303 * either on first call (launcher/widget/notification) or after switching from an existing
1304 * folder: Inbox -> Folder. Repeated calls are sent when switching back to the folder. Inbox
1305 * -> Folder -> Spam -> Folder will generate two calls to respond() with the value true for
1306 * "Folder".
1307 * <p>
1308 * A provider that implements this command should include the
1309 * {@link #COMMAND_KEY_SET_VISIBILITY} key in its response with a value of
1310 * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. This is <b>always</b>
1311 * set with {@link #COMMAND_KEY_SET_VISIBILITY} because this is only set when the folder
1312 * list is made visible.
1313 */
1314 public static final String COMMAND_KEY_ENTERED_FOLDER = "enteredFolder";
1315
Paul Westbrook983a7232013-05-15 12:30:15 -07001316 /**
1317 * This key has an int value, indicating the position that the UI wants to notify the
1318 * provider that the data from a specified row is being shown to the user.
1319 * <p>
1320 * A provider that implements this command should include the
1321 * {@link #COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE} key in its response with a value of
1322 * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}.
1323 */
1324 public static final String COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE = "uiPositionChange";
1325
Andy Huang7f39bbd2013-05-20 20:36:38 -07001326 /**
1327 * Rather than jamming a {@link ConversationInfo} into a byte-array blob to be read out of
1328 * a cursor, providers can optionally implement this command to directly return the object
1329 * in a Bundle.
1330 * <p>
Andy Huangfa225db2013-05-20 22:15:19 -07001331 * The requestor (UI code) will place a meaningless value in the request Bundle. The UI will
1332 * also move the cursor position to the desired place prior to calling respond(). Providers
1333 * should just use {@link Bundle#containsKey(String)} to check for this kind of request and
1334 * generate an object at the current cursor position.
Andy Huang7f39bbd2013-05-20 20:36:38 -07001335 * <p>
1336 * A provider that implements this command should include the
1337 * {@link #COMMAND_GET_CONVERSATION_INFO} key in its response with a
1338 * {@link ConversationInfo} Parcelable object as its value.
1339 */
Andy Huangf8b613c2013-05-24 15:20:44 -07001340 public static final String COMMAND_GET_CONVERSATION_INFO =
1341 ConversationColumns.CONVERSATION_INFO;
Andy Huang7f39bbd2013-05-20 20:36:38 -07001342
1343 /**
1344 * Rather than jamming a {@link FolderList} into a byte-array blob to be read out of
1345 * a cursor, providers can optionally implement this command to directly return the object
1346 * in a Bundle.
1347 * <p>
Andy Huangfa225db2013-05-20 22:15:19 -07001348 * The requestor (UI code) will place a meaningless value in the request Bundle. The UI will
1349 * also move the cursor position to the desired place prior to calling respond(). Providers
1350 * should just use {@link Bundle#containsKey(String)} to check for this kind of request and
1351 * generate an object at the current cursor position.
Andy Huang7f39bbd2013-05-20 20:36:38 -07001352 * <p>
1353 * A provider that implements this command should include the
1354 * {@link #COMMAND_GET_RAW_FOLDERS} key in its response with a
1355 * {@link FolderList} Parcelable object as its value.
1356 */
Andy Huangf8b613c2013-05-24 15:20:44 -07001357 public static final String COMMAND_GET_RAW_FOLDERS = ConversationColumns.RAW_FOLDERS;
Andy Huang7f39bbd2013-05-20 20:36:38 -07001358
Andy Huangca854412012-04-20 19:55:38 -07001359 private ConversationCursorCommand() {}
1360 }
1361
Mindy Pereira6f92de62011-12-19 11:31:48 -08001362 /**
Paul Westbrook334e64a2012-02-23 13:26:35 -08001363 * List of operations that can can be performed on a conversation. These operations are applied
1364 * with {@link ContentProvider#update(Uri, ContentValues, String, String[])}
1365 * where the conversation uri is specified, and the ContentValues specifies the operation to
1366 * be performed.
1367 * <p/>
1368 * The operation to be performed is specified in the ContentValues by
1369 * the {@link ConversationOperations#OPERATION_KEY}
1370 * <p/>
1371 * Note not all UI providers will support these operations. {@link AccountCapabilities} can
1372 * be used to determine which operations are supported.
Mindy Pereira6f92de62011-12-19 11:31:48 -08001373 */
Paul Westbrook334e64a2012-02-23 13:26:35 -08001374 public static final class ConversationOperations {
1375 /**
1376 * ContentValues key used to specify the operation to be performed
1377 */
1378 public static final String OPERATION_KEY = "operation";
1379
1380 /**
1381 * Archive operation
1382 */
1383 public static final String ARCHIVE = "archive";
1384
1385 /**
1386 * Mute operation
1387 */
1388 public static final String MUTE = "mute";
1389
1390 /**
1391 * Report spam operation
1392 */
1393 public static final String REPORT_SPAM = "report_spam";
1394
Paul Westbrook77eee622012-07-10 13:41:57 -07001395 /**
1396 * Report not spam operation
1397 */
1398 public static final String REPORT_NOT_SPAM = "report_not_spam";
1399
Paul Westbrook76b20622012-07-12 11:45:43 -07001400 /**
1401 * Report phishing operation
1402 */
1403 public static final String REPORT_PHISHING = "report_phishing";
1404
Paul Westbrookef362542012-08-27 14:53:32 -07001405 /**
1406 * Discard drafts operation
1407 */
1408 public static final String DISCARD_DRAFTS = "discard_drafts";
1409
mindypcb0b30e2012-11-30 10:16:35 -08001410 /**
1411 * Update conversation folder(s) operation. ContentValues passed as part
1412 * of this update will be of the format (FOLDERS_UPDATED, csv of updated
1413 * folders) where the comma separated values of the updated folders will
1414 * be of the format: folderuri/ADD_VALUE. ADD_VALUE will be true if the
1415 * folder was added, false if it was removed.
1416 */
1417 public static final String FOLDERS_UPDATED = "folders_updated";
1418 public static final String FOLDERS_UPDATED_SPLIT_PATTERN = ",";
Paul Westbrook5109c512012-11-05 11:00:30 -08001419
1420 public static final class Parameters {
1421 /**
1422 * Boolean indicating whether the undo for this operation should be suppressed
1423 */
1424 public static final String SUPPRESS_UNDO = "suppress_undo";
1425
1426 private Parameters() {}
1427 }
1428
Paul Westbrook334e64a2012-02-23 13:26:35 -08001429 private ConversationOperations() {
1430 }
1431 }
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001432
Paul Westbrook72e2ea82012-10-22 16:25:22 -07001433 /**
1434 * Methods that can be "called" using the account uri, through
Tony Mantlera7165dd2013-08-08 16:09:24 -07001435 * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)}
1436 * Note, the arg parmateter of call should be the account uri.
Paul Westbrook72e2ea82012-10-22 16:25:22 -07001437 */
1438 public static final class AccountCallMethods {
1439 /**
1440 * Save message method. The Bundle for the call to
Tony Mantlera7165dd2013-08-08 16:09:24 -07001441 * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the
1442 * columns specified in {@link MessageColumns}, and if this is a save for an existing
1443 * message, an entry for the {@link MessageColumns#URI} should reference the existing
1444 * message
Paul Westbrook72e2ea82012-10-22 16:25:22 -07001445 *
1446 * The Bundle returned will contain the message uri in the returned bundled with the
1447 * {@link MessageColumns#URI} key.
1448 */
1449 public static final String SAVE_MESSAGE = "save_message";
1450
1451 /**
1452 * Send message method. The Bundle for the call to
Tony Mantlera7165dd2013-08-08 16:09:24 -07001453 * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the
1454 * columns specified in {@link MessageColumns}, and if this is a send of an existing
1455 * message, an entry for the {@link MessageColumns#URI} should reference the existing
1456 * message
Paul Westbrook72e2ea82012-10-22 16:25:22 -07001457 *
1458 * The Bundle returned will contain the message uri in the returned bundled with the
1459 * {@link MessageColumns#URI} key.
1460 */
1461 public static final String SEND_MESSAGE = "send_message";
1462
Scott Banachowski53a615d2012-12-19 15:31:20 -08001463 /**
1464 * Change account method. The Bundle for the call to
Tony Mantlera7165dd2013-08-08 16:09:24 -07001465 * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the
1466 * columns specified in {@link SetCurrentAccountColumns}
Scott Banachowski53a615d2012-12-19 15:31:20 -08001467 *
1468 * The Bundle returned will be empty.
1469 */
1470 public static final String SET_CURRENT_ACCOUNT = "set_current_account";
1471
Paul Westbrook72e2ea82012-10-22 16:25:22 -07001472 private AccountCallMethods() {}
1473 }
1474
Paul Westbrook3c7f94d2012-10-23 14:13:00 -07001475 /**
1476 * Keys used for parameters to {@link AccountCallMethods#SEND_MESSAGE} or
1477 * {@link AccountCallMethods#SAVE_MESSAGE} methods.
1478 */
1479 public static final class SendOrSaveMethodParamKeys {
1480 /**
1481 * Bundle key used to store any opened file descriptors.
1482 * The keys of this Bundle are the contentUri for each attachment, and the
1483 * values are {@link android.os.ParcelFileDescriptor} objects.
1484 */
1485 public static final String OPENED_FD_MAP = "opened_fds";
1486
1487 private SendOrSaveMethodParamKeys() {}
1488 }
1489
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001490 public static final class DraftType {
Andy Huang97c25be2012-01-12 15:12:09 -08001491 public static final int NOT_A_DRAFT = 0;
1492 public static final int COMPOSE = 1;
1493 public static final int REPLY = 2;
1494 public static final int REPLY_ALL = 3;
1495 public static final int FORWARD = 4;
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001496
1497 private DraftType() {}
Mindy Pereira6f92de62011-12-19 11:31:48 -08001498 }
1499
Andrew Sapperstein3b08c512012-07-11 16:51:07 -07001500 /**
1501 * Class for the enum values to determine whether this
1502 * string should be displayed as a high priority warning
1503 * or a low priority warning. The current design has
1504 * high priority warnings in red while low priority warnings
1505 * are grey.
1506 */
1507 public static final class SpamWarningLevel {
1508 public static final int NO_WARNING = 0;
1509 public static final int LOW_WARNING = 1;
1510 public static final int HIGH_WARNING = 2;
1511
1512 private SpamWarningLevel() {}
1513 }
1514
1515 /**
1516 * Class for the enum values to determine which type
1517 * of link to show in the spam warning.
1518 */
1519 public static final class SpamWarningLinkType {
1520 public static final int NO_LINK = 0;
1521 public static final int IGNORE_WARNING = 1;
1522 public static final int REPORT_PHISHING = 2;
1523
1524 private SpamWarningLinkType() {}
1525 }
1526
Mindy Pereiraa1406072011-12-22 10:54:06 -08001527 public static final String[] MESSAGE_PROJECTION = {
1528 BaseColumns._ID,
Mindy Pereira326c6602012-01-04 15:32:42 -08001529 MessageColumns.SERVER_ID,
Mindy Pereiraa1406072011-12-22 10:54:06 -08001530 MessageColumns.URI,
Mindy Pereiraa1406072011-12-22 10:54:06 -08001531 MessageColumns.CONVERSATION_ID,
1532 MessageColumns.SUBJECT,
1533 MessageColumns.SNIPPET,
1534 MessageColumns.FROM,
1535 MessageColumns.TO,
1536 MessageColumns.CC,
1537 MessageColumns.BCC,
1538 MessageColumns.REPLY_TO,
1539 MessageColumns.DATE_RECEIVED_MS,
1540 MessageColumns.BODY_HTML,
1541 MessageColumns.BODY_TEXT,
1542 MessageColumns.EMBEDS_EXTERNAL_RESOURCES,
1543 MessageColumns.REF_MESSAGE_ID,
1544 MessageColumns.DRAFT_TYPE,
Mindy Pereira3ce64e72012-01-13 14:29:45 -08001545 MessageColumns.APPEND_REF_MESSAGE_CONTENT,
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001546 MessageColumns.HAS_ATTACHMENTS,
Mindy Pereira326c6602012-01-04 15:32:42 -08001547 MessageColumns.ATTACHMENT_LIST_URI,
James Lemieux934b1f42014-04-09 12:59:29 -07001548 MessageColumns.ATTACHMENT_BY_CID_URI,
Mindy Pereiraf944e962012-01-17 11:43:36 -08001549 MessageColumns.MESSAGE_FLAGS,
Mindy Pereirae8caf122012-03-20 15:23:31 -07001550 MessageColumns.ALWAYS_SHOW_IMAGES,
Andy Huangd8e249e2012-03-21 17:01:37 -07001551 MessageColumns.READ,
Scott Kennedyd5edd2d2012-12-05 11:11:32 -08001552 MessageColumns.SEEN,
Andy Huangd8e249e2012-03-21 17:01:37 -07001553 MessageColumns.STARRED,
Andy Huang5a929072012-03-23 20:17:10 -07001554 MessageColumns.QUOTE_START_POS,
Mindy Pereira92551d02012-04-05 11:31:12 -07001555 MessageColumns.ATTACHMENTS,
Mindy Pereira62de1b12012-04-06 12:17:56 -07001556 MessageColumns.CUSTOM_FROM_ADDRESS,
Marc Blank3842af92012-04-27 09:06:09 -07001557 MessageColumns.MESSAGE_ACCOUNT_URI,
Andrew Sapperstein3b08c512012-07-11 16:51:07 -07001558 MessageColumns.EVENT_INTENT_URI,
1559 MessageColumns.SPAM_WARNING_STRING,
1560 MessageColumns.SPAM_WARNING_LEVEL,
Andrew Sappersteind5b369b2012-07-13 12:38:46 -07001561 MessageColumns.SPAM_WARNING_LINK_TYPE,
Andy Huang47aa9c92012-07-31 15:37:21 -07001562 MessageColumns.VIA_DOMAIN,
Andrew Sappersteinf59d01c2014-02-20 10:27:06 -08001563 MessageColumns.IS_SENDING,
Andrew Sapperstein20c20822014-04-16 11:47:19 -07001564 MessageColumns.CLIPPED,
1565 MessageColumns.PERMALINK
Mindy Pereiraa1406072011-12-22 10:54:06 -08001566 };
1567
Mindy Pereiraf944e962012-01-17 11:43:36 -08001568 /** Separates attachment info parts in strings in a message. */
Andy Huang5c5fd572012-04-08 18:19:29 -07001569 @Deprecated
Mindy Pereiraf944e962012-01-17 11:43:36 -08001570 public static final String MESSAGE_ATTACHMENT_INFO_SEPARATOR = "\n";
Mindy Pereiraa1406072011-12-22 10:54:06 -08001571 public static final String MESSAGE_LIST_TYPE =
1572 "vnd.android.cursor.dir/vnd.com.android.mail.message";
1573 public static final String MESSAGE_TYPE =
1574 "vnd.android.cursor.item/vnd.com.android.mail.message";
Mindy Pereira6f92de62011-12-19 11:31:48 -08001575
Mindy Pereira6349a042012-01-04 11:25:01 -08001576 public static final int MESSAGE_ID_COLUMN = 0;
Mindy Pereira326c6602012-01-04 15:32:42 -08001577 public static final int MESSAGE_SERVER_ID_COLUMN = 1;
1578 public static final int MESSAGE_URI_COLUMN = 2;
Marc Blank26846d82012-03-22 18:12:54 -07001579 public static final int MESSAGE_CONVERSATION_URI_COLUMN = 3;
Mindy Pereira326c6602012-01-04 15:32:42 -08001580 public static final int MESSAGE_SUBJECT_COLUMN = 4;
1581 public static final int MESSAGE_SNIPPET_COLUMN = 5;
1582 public static final int MESSAGE_FROM_COLUMN = 6;
1583 public static final int MESSAGE_TO_COLUMN = 7;
1584 public static final int MESSAGE_CC_COLUMN = 8;
1585 public static final int MESSAGE_BCC_COLUMN = 9;
1586 public static final int MESSAGE_REPLY_TO_COLUMN = 10;
1587 public static final int MESSAGE_DATE_RECEIVED_MS_COLUMN = 11;
Mindy Pereira16668162012-01-11 16:11:19 -08001588 public static final int MESSAGE_BODY_HTML_COLUMN = 12;
1589 public static final int MESSAGE_BODY_TEXT_COLUMN = 13;
Mindy Pereira326c6602012-01-04 15:32:42 -08001590 public static final int MESSAGE_EMBEDS_EXTERNAL_RESOURCES_COLUMN = 14;
Alice Yanga990a712013-03-13 18:37:00 -07001591 public static final int MESSAGE_REF_MESSAGE_URI_COLUMN = 15;
Mindy Pereira326c6602012-01-04 15:32:42 -08001592 public static final int MESSAGE_DRAFT_TYPE_COLUMN = 16;
Mindy Pereira3ce64e72012-01-13 14:29:45 -08001593 public static final int MESSAGE_APPEND_REF_MESSAGE_CONTENT_COLUMN = 17;
1594 public static final int MESSAGE_HAS_ATTACHMENTS_COLUMN = 18;
1595 public static final int MESSAGE_ATTACHMENT_LIST_URI_COLUMN = 19;
James Lemieux934b1f42014-04-09 12:59:29 -07001596 public static final int MESSAGE_ATTACHMENT_BY_CID_URI_COLUMN = 20;
1597 public static final int MESSAGE_FLAGS_COLUMN = 21;
1598 public static final int MESSAGE_ALWAYS_SHOW_IMAGES_COLUMN = 22;
1599 public static final int MESSAGE_READ_COLUMN = 23;
1600 public static final int MESSAGE_SEEN_COLUMN = 24;
1601 public static final int MESSAGE_STARRED_COLUMN = 25;
1602 public static final int QUOTED_TEXT_OFFSET_COLUMN = 26;
1603 public static final int MESSAGE_ATTACHMENTS_COLUMN = 27;
1604 public static final int MESSAGE_CUSTOM_FROM_ADDRESS_COLUMN = 28;
1605 public static final int MESSAGE_ACCOUNT_URI_COLUMN = 29;
1606 public static final int MESSAGE_EVENT_INTENT_COLUMN = 30;
1607 public static final int MESSAGE_SPAM_WARNING_STRING_ID_COLUMN = 31;
1608 public static final int MESSAGE_SPAM_WARNING_LEVEL_COLUMN = 32;
1609 public static final int MESSAGE_SPAM_WARNING_LINK_TYPE_COLUMN = 33;
1610 public static final int MESSAGE_VIA_DOMAIN_COLUMN = 34;
1611 public static final int MESSAGE_IS_SENDING_COLUMN = 35;
1612 public static final int MESSAGE_CLIPPED_COLUMN = 36;
1613 public static final int MESSAGE_PERMALINK_COLUMN = 37;
Paul Westbrook9cf43892012-03-15 15:43:47 -07001614
1615 public static final class CursorStatus {
1616 // The cursor is actively loading more data
1617 public static final int LOADING = 1 << 0;
1618
1619 // The cursor is currently not loading more data, but more data may be available
1620 public static final int LOADED = 1 << 1;
1621
1622 // An error occured while loading data
1623 public static final int ERROR = 1 << 2;
1624
1625 // The cursor is loaded, and there will be no more data
1626 public static final int COMPLETE = 1 << 3;
Paul Westbrook573b9e62012-08-02 14:56:17 -07001627
1628 public static boolean isWaitingForResults(int cursorStatus) {
1629 return 0 != (cursorStatus & LOADING);
1630 }
Paul Westbrook9cf43892012-03-15 15:43:47 -07001631 }
1632
1633
1634 public static final class CursorExtraKeys {
1635 /**
1636 * This integer column contains the staus of the message cursor. The value will be
1637 * one defined in {@link CursorStatus}.
1638 */
Paul Westbrook7a3e6572012-08-02 16:33:58 -07001639 public static final String EXTRA_STATUS = "cursor_status";
Paul Westbrook9cf43892012-03-15 15:43:47 -07001640
1641 /**
1642 * Used for finding the cause of an error.
1643 * TODO: define these values
1644 */
Paul Westbrook7a3e6572012-08-02 16:33:58 -07001645 public static final String EXTRA_ERROR = "cursor_error";
Paul Westbrook9cf43892012-03-15 15:43:47 -07001646
Yu Ping Hucbde5fa2013-03-04 21:57:04 -08001647
1648 /**
1649 * This integer column contains the total message count for this folder.
1650 */
1651 public static final String EXTRA_TOTAL_COUNT = "cursor_total_count";
Paul Westbrook9cf43892012-03-15 15:43:47 -07001652 }
1653
Paul Westbrook2388c5d2012-03-25 12:29:11 -07001654 public static final class AccountCursorExtraKeys {
1655 /**
1656 * This integer column contains the staus of the account cursor. The value will be
1657 * 1 if all accounts have been fully loaded or 0 if the account list hasn't been fully
1658 * initialized
1659 */
1660 public static final String ACCOUNTS_LOADED = "accounts_loaded";
1661 }
1662
Paul Westbrook9cf43892012-03-15 15:43:47 -07001663
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001664 public static final class MessageFlags {
Andy Huang47aa9c92012-07-31 15:37:21 -07001665 public static final int REPLIED = 1 << 2;
1666 public static final int FORWARDED = 1 << 3;
1667 public static final int CALENDAR_INVITE = 1 << 4;
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001668 }
1669
Mindy Pereira6f92de62011-12-19 11:31:48 -08001670 public static final class MessageColumns {
Andy Huangdb977472012-01-11 19:53:25 -08001671 /**
1672 * This string column contains a content provider URI that points to this single message.
1673 */
Mindy Pereira6349a042012-01-04 11:25:01 -08001674 public static final String URI = "messageUri";
Andy Huangdb977472012-01-11 19:53:25 -08001675 /**
1676 * This string column contains a server-assigned ID for this message.
1677 */
1678 public static final String SERVER_ID = "serverMessageId";
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001679 public static final String CONVERSATION_ID = "conversationId";
Andy Huangdb977472012-01-11 19:53:25 -08001680 /**
1681 * This string column contains the subject of a message.
1682 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001683 public static final String SUBJECT = "subject";
Andy Huangdb977472012-01-11 19:53:25 -08001684 /**
1685 * This string column contains a snippet of the message body.
1686 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001687 public static final String SNIPPET = "snippet";
Andy Huangdb977472012-01-11 19:53:25 -08001688 /**
1689 * This string column contains the single email address (and optionally name) of the sender.
1690 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001691 public static final String FROM = "fromAddress";
Andy Huangdb977472012-01-11 19:53:25 -08001692 /**
1693 * This string column contains a comma-delimited list of "To:" recipient email addresses.
1694 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001695 public static final String TO = "toAddresses";
Andy Huangdb977472012-01-11 19:53:25 -08001696 /**
1697 * This string column contains a comma-delimited list of "CC:" recipient email addresses.
1698 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001699 public static final String CC = "ccAddresses";
Andy Huangdb977472012-01-11 19:53:25 -08001700 /**
1701 * This string column contains a comma-delimited list of "BCC:" recipient email addresses.
1702 * This value will be null for incoming messages.
1703 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001704 public static final String BCC = "bccAddresses";
Andy Huangdb977472012-01-11 19:53:25 -08001705 /**
1706 * This string column contains the single email address (and optionally name) of the
1707 * sender's reply-to address.
1708 */
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001709 public static final String REPLY_TO = "replyToAddress";
Andy Huangdb977472012-01-11 19:53:25 -08001710 /**
1711 * This long column contains the timestamp (in millis) of receipt of the message.
1712 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001713 public static final String DATE_RECEIVED_MS = "dateReceivedMs";
Andy Huangdb977472012-01-11 19:53:25 -08001714 /**
1715 * This string column contains the HTML form of the message body, if available. If not,
1716 * a provider must populate BODY_TEXT.
1717 */
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001718 public static final String BODY_HTML = "bodyHtml";
Andy Huangdb977472012-01-11 19:53:25 -08001719 /**
1720 * This string column contains the plaintext form of the message body, if HTML is not
1721 * otherwise available. If HTML is available, this value should be left empty (null).
1722 */
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001723 public static final String BODY_TEXT = "bodyText";
Mindy Pereira6f92de62011-12-19 11:31:48 -08001724 public static final String EMBEDS_EXTERNAL_RESOURCES = "bodyEmbedsExternalResources";
Mindy Pereira3ce64e72012-01-13 14:29:45 -08001725 /**
1726 * This string column contains an opaque string used by the sendMessage api.
1727 */
Mindy Pereira6f92de62011-12-19 11:31:48 -08001728 public static final String REF_MESSAGE_ID = "refMessageId";
Andy Huangdb977472012-01-11 19:53:25 -08001729 /**
Andy Huang97c25be2012-01-12 15:12:09 -08001730 * This integer column contains the type of this draft, or zero (0) if this message is not a
1731 * draft. See {@link DraftType} for possible values.
Andy Huangdb977472012-01-11 19:53:25 -08001732 */
Paul Westbrook82ea6da2011-12-15 11:03:51 -08001733 public static final String DRAFT_TYPE = "draftType";
Andy Huangdb977472012-01-11 19:53:25 -08001734 /**
1735 * This boolean column indicates whether an outgoing message should trigger special quoted
1736 * text processing upon send. The value should default to zero (0) for protocols that do
1737 * not support or require this flag, and for all incoming messages.
1738 */
Mindy Pereira3ce64e72012-01-13 14:29:45 -08001739 public static final String APPEND_REF_MESSAGE_CONTENT = "appendRefMessageContent";
Andy Huangdb977472012-01-11 19:53:25 -08001740 /**
1741 * This boolean column indicates whether a message has attachments. The list of attachments
1742 * can be retrieved using the URI in {@link MessageColumns#ATTACHMENT_LIST_URI}.
1743 */
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001744 public static final String HAS_ATTACHMENTS = "hasAttachments";
Andy Huangdb977472012-01-11 19:53:25 -08001745 /**
Mindy Pereira7ed1c112012-01-18 10:59:25 -08001746 * This string column contains the content provider URI for the list of
Andy Huang4f347e82014-02-25 17:32:28 -08001747 * attachments associated with this message.<br>
1748 * <br>
1749 * The resulting cursor MUST have the columns as defined in
1750 * {@link com.android.ex.photo.provider.PhotoContract.PhotoViewColumns}.
Andy Huangdb977472012-01-11 19:53:25 -08001751 */
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001752 public static final String ATTACHMENT_LIST_URI = "attachmentListUri";
Andy Huangdb977472012-01-11 19:53:25 -08001753 /**
James Lemieux934b1f42014-04-09 12:59:29 -07001754 * This string column contains the content provider URI for the details of an attachment
1755 * associated with this message. (CID to be appended at the time the URI is used)
1756 */
1757 public static final String ATTACHMENT_BY_CID_URI = "attachmentByCidUri";
1758 /**
Andy Huangdb977472012-01-11 19:53:25 -08001759 * This long column is a bit field of flags defined in {@link MessageFlags}.
1760 */
Andy Huang732600e2012-01-10 17:47:17 -08001761 public static final String MESSAGE_FLAGS = "messageFlags";
Mindy Pereiraf944e962012-01-17 11:43:36 -08001762 /**
Paul Westbrook104f7292012-02-28 16:07:07 -08001763 * This integer column represents whether the user has specified that images should always
1764 * be shown. The value of "1" indicates that the user has specified that images should be
1765 * shown, while the value of "0" indicates that the user should be prompted before loading
1766 * any external images.
1767 */
1768 public static final String ALWAYS_SHOW_IMAGES = "alwaysShowImages";
1769
Mindy Pereirae8caf122012-03-20 15:23:31 -07001770 /**
Andy Huangd8e249e2012-03-21 17:01:37 -07001771 * This boolean column indicates whether the message has been read
1772 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001773 public static final String READ = "read";
Andy Huangd8e249e2012-03-21 17:01:37 -07001774
1775 /**
Scott Kennedyd5edd2d2012-12-05 11:11:32 -08001776 * This boolean column indicates whether the message has been seen
1777 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001778 public static final String SEEN = "seen";
Scott Kennedyd5edd2d2012-12-05 11:11:32 -08001779
1780 /**
Andy Huangd8e249e2012-03-21 17:01:37 -07001781 * This boolean column indicates whether the message has been starred
1782 */
Paul Westbrookb8911732013-04-28 11:54:49 -07001783 public static final String STARRED = "starred";
Andy Huangd8e249e2012-03-21 17:01:37 -07001784
1785 /**
Mindy Pereirae8caf122012-03-20 15:23:31 -07001786 * This integer column represents the offset in the message of quoted
1787 * text. If include_quoted_text is zero, the value contained in this
1788 * column is invalid.
1789 */
1790 public static final String QUOTE_START_POS = "quotedTextStartPos";
1791
Andy Huang5a929072012-03-23 20:17:10 -07001792 /**
1793 * This string columns contains a JSON array of serialized {@link Attachment} objects.
1794 */
1795 public static final String ATTACHMENTS = "attachments";
Mindy Pereira92551d02012-04-05 11:31:12 -07001796 public static final String CUSTOM_FROM_ADDRESS = "customFrom";
Mindy Pereira62de1b12012-04-06 12:17:56 -07001797 /**
1798 * Uri of the account associated with this message. Except in the case
1799 * of showing a combined view, this column is almost always empty.
1800 */
1801 public static final String MESSAGE_ACCOUNT_URI = "messageAccountUri";
Marc Blank3842af92012-04-27 09:06:09 -07001802 /**
Andy Huange623a0f2012-07-12 15:01:23 -07001803 * Intent Uri to launch when the user wants to view an event in their calendar, or null.
Marc Blank3842af92012-04-27 09:06:09 -07001804 */
1805 public static final String EVENT_INTENT_URI = "eventIntentUri";
Andrew Sapperstein3b08c512012-07-11 16:51:07 -07001806 /**
Andrew Sappersteind5b369b2012-07-13 12:38:46 -07001807 * This string column contains the string for the spam
Andrew Sapperstein3b08c512012-07-11 16:51:07 -07001808 * warning of this message, or null if there is no spam warning for the message.
1809 */
1810 public static final String SPAM_WARNING_STRING = "spamWarningString";
1811 /**
1812 * This integer column contains the level of spam warning of this message,
1813 * or zero (0) if this message does not have a warning level.
1814 * See {@link SpamWarningLevel} for possible values.
1815 */
1816 public static final String SPAM_WARNING_LEVEL = "spamWarningLevel";
1817 /**
1818 * This integer column contains the type of link for the spam warning
1819 * of this message, or zero (0) if this message does not have a link type.
1820 * See {@link SpamWarningLinkType} for possible values.
1821 */
1822 public static final String SPAM_WARNING_LINK_TYPE = "spamWarningLinkType";
Andrew Sappersteind5b369b2012-07-13 12:38:46 -07001823 /**
1824 * This string column contains the string for the via domain
1825 * to be included if this message was sent via an alternate
1826 * domain. This column should be null if no via domain exists.
1827 */
1828 public static final String VIA_DOMAIN = "viaDomain";
Andy Huang47aa9c92012-07-31 15:37:21 -07001829 /**
1830 * This boolean column indicates whether the message is an outgoing message in the process
1831 * of being sent (will be zero for incoming messages and messages that are already sent).
1832 */
1833 public static final String IS_SENDING = "isSending";
Andrew Sappersteinf59d01c2014-02-20 10:27:06 -08001834 /**
1835 * This boolean column indicates whether the message body has been clipped.
1836 */
1837 public static final String CLIPPED = "clipped";
Andrew Sapperstein20c20822014-04-16 11:47:19 -07001838 /**
1839 * This string column contains the permalink value of the conversation
1840 * for which this message belongs or null if one does not exist.
1841 */
1842 public static final String PERMALINK = "permalink";
Andrew Sapperstein3b08c512012-07-11 16:51:07 -07001843
Mindy Pereira6f92de62011-12-19 11:31:48 -08001844 private MessageColumns() {}
1845 }
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001846
Scott Banachowski53a615d2012-12-19 15:31:20 -08001847 public static final class SetCurrentAccountColumns {
1848 /**
1849 * This column contains the Account object Parcelable.
1850 */
1851 public static final String ACCOUNT = "account";
1852
1853 private SetCurrentAccountColumns() {}
1854 }
1855
Marc Blank922c3eb2012-04-24 08:41:53 -07001856 /**
1857 * List of operations that can can be performed on a message. These operations are applied
1858 * with {@link ContentProvider#update(Uri, ContentValues, String, String[])}
1859 * where the message uri is specified, and the ContentValues specifies the operation to
1860 * be performed, e.g. values.put(RESPOND_COLUMN, RESPOND_ACCEPT)
1861 * <p/>
1862 * Note not all UI providers will support these operations.
1863 */
1864 public static final class MessageOperations {
1865 /**
1866 * Respond to a calendar invitation
1867 */
1868 public static final String RESPOND_COLUMN = "respond";
1869
1870 public static final int RESPOND_ACCEPT = 1;
1871 public static final int RESPOND_TENTATIVE = 2;
1872 public static final int RESPOND_DECLINE = 3;
1873
1874 private MessageOperations() {
1875 }
1876 }
1877
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001878 public static final String ATTACHMENT_LIST_TYPE =
1879 "vnd.android.cursor.dir/vnd.com.android.mail.attachment";
1880 public static final String ATTACHMENT_TYPE =
1881 "vnd.android.cursor.item/vnd.com.android.mail.attachment";
1882
1883 public static final String[] ATTACHMENT_PROJECTION = {
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001884 AttachmentColumns.NAME,
1885 AttachmentColumns.SIZE,
Mindy Pereira7a07fb42012-01-11 10:32:48 -08001886 AttachmentColumns.URI,
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001887 AttachmentColumns.CONTENT_TYPE,
Andy Huange0b83b82012-03-06 19:57:04 -08001888 AttachmentColumns.STATE,
1889 AttachmentColumns.DESTINATION,
1890 AttachmentColumns.DOWNLOADED_SIZE,
1891 AttachmentColumns.CONTENT_URI,
1892 AttachmentColumns.THUMBNAIL_URI,
Mark Weibbe74ae2012-11-19 11:20:09 -08001893 AttachmentColumns.PREVIEW_INTENT_URI,
Andrew Sapperstein7434e802013-06-21 11:26:49 -07001894 AttachmentColumns.PROVIDER_DATA,
Mark Weibeaf1e42013-08-05 17:52:48 -07001895 AttachmentColumns.SUPPORTS_DOWNLOAD_AGAIN,
Martin Hibdon519c2182013-09-20 17:27:57 -07001896 AttachmentColumns.TYPE,
James Lemieux934b1f42014-04-09 12:59:29 -07001897 AttachmentColumns.FLAGS,
1898 AttachmentColumns.CONTENT_ID
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001899 };
Andy Huang109369d2012-03-07 20:05:31 -08001900 public static final int ATTACHMENT_NAME_COLUMN = 0;
1901 public static final int ATTACHMENT_SIZE_COLUMN = 1;
1902 public static final int ATTACHMENT_URI_COLUMN = 2;
1903 public static final int ATTACHMENT_CONTENT_TYPE_COLUMN = 3;
1904 public static final int ATTACHMENT_STATE_COLUMN = 4;
1905 public static final int ATTACHMENT_DESTINATION_COLUMN = 5;
1906 public static final int ATTACHMENT_DOWNLOADED_SIZE_COLUMN = 6;
1907 public static final int ATTACHMENT_CONTENT_URI_COLUMN = 7;
1908 public static final int ATTACHMENT_THUMBNAIL_URI_COLUMN = 8;
1909 public static final int ATTACHMENT_PREVIEW_INTENT_COLUMN = 9;
Andrew Sapperstein7434e802013-06-21 11:26:49 -07001910 public static final int ATTACHMENT_SUPPORTS_DOWNLOAD_AGAIN_COLUMN = 10;
Mark Weibeaf1e42013-08-05 17:52:48 -07001911 public static final int ATTACHMENT_TYPE_COLUMN = 11;
Martin Hibdon519c2182013-09-20 17:27:57 -07001912 public static final int ATTACHMENT_FLAGS_COLUMN = 12;
James Lemieux934b1f42014-04-09 12:59:29 -07001913 public static final int ATTACHMENT_CONTENT_ID_COLUMN = 13;
Mindy Pereiraf30cc092011-12-29 14:02:40 -08001914
Mark Wei479505d2013-03-21 06:04:46 -07001915 /** Separates attachment info parts in strings in the database. */
1916 public static final String ATTACHMENT_INFO_SEPARATOR = "\n"; // use to join
1917 public static final Pattern ATTACHMENT_INFO_SEPARATOR_PATTERN =
1918 Pattern.compile(ATTACHMENT_INFO_SEPARATOR); // use to split
1919 public static final String ATTACHMENT_INFO_DELIMITER = "|"; // use to join
1920 // use to split
1921 public static final Pattern ATTACHMENT_INFO_DELIMITER_PATTERN = Pattern.compile("\\|");
1922
Andy Huange0b83b82012-03-06 19:57:04 -08001923 /**
1924 * Valid states for the {@link AttachmentColumns#STATE} column.
1925 *
1926 */
1927 public static final class AttachmentState {
1928 /**
1929 * The full attachment is not present on device. When used as a command,
1930 * setting this state will tell the provider to cancel a download in
1931 * progress.
1932 * <p>
Mark Weif6fac0a2013-02-11 20:58:17 -08001933 * Valid next states: {@link #DOWNLOADING}, {@link #PAUSED}
Andy Huange0b83b82012-03-06 19:57:04 -08001934 */
1935 public static final int NOT_SAVED = 0;
1936 /**
1937 * The most recent attachment download attempt failed. The current UI
1938 * design does not require providers to persist this state, but
1939 * providers must return this state at least once after a download
1940 * failure occurs. This state may not be used as a command.
1941 * <p>
1942 * Valid next states: {@link #DOWNLOADING}
1943 */
1944 public static final int FAILED = 1;
1945 /**
1946 * The attachment is currently being downloaded by the provider.
1947 * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current
1948 * download progress while in this state. When used as a command,
1949 * setting this state will tell the provider to initiate a download to
1950 * the accompanying destination in {@link AttachmentColumns#DESTINATION}
1951 * .
1952 * <p>
1953 * Valid next states: {@link #NOT_SAVED}, {@link #FAILED},
1954 * {@link #SAVED}
1955 */
1956 public static final int DOWNLOADING = 2;
1957 /**
1958 * The attachment was successfully downloaded to the destination in
1959 * {@link AttachmentColumns#DESTINATION}. If a provider later detects
1960 * that a download is missing, it should reset the state to
1961 * {@link #NOT_SAVED}. This state may not be used as a command on its
1962 * own. To move a file from cache to external, update
1963 * {@link AttachmentColumns#DESTINATION}.
1964 * <p>
Mark Weif6fac0a2013-02-11 20:58:17 -08001965 * Valid next states: {@link #NOT_SAVED}, {@link #PAUSED}
Andy Huange0b83b82012-03-06 19:57:04 -08001966 */
1967 public static final int SAVED = 3;
Mark Wei47ca4e22012-10-17 16:20:15 -07001968 /**
1969 * This is only used as a command, not as a state. The attachment is
1970 * currently being redownloaded by the provider.
1971 * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current
1972 * download progress while in this state. When used as a command,
1973 * setting this state will tell the provider to initiate a download to
1974 * the accompanying destination in {@link AttachmentColumns#DESTINATION}
1975 * .
Mark Wei47ca4e22012-10-17 16:20:15 -07001976 */
1977 public static final int REDOWNLOADING = 4;
Mark Wei7bed4bc2013-01-22 22:56:22 -08001978 /**
1979 * The attachment is either pending or paused in the download manager.
1980 * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current
1981 * download progress while in this state. This state may not be used as
1982 * a command on its own.
1983 * <p>
1984 * Valid next states: {@link #DOWNLOADING}, {@link #FAILED}
1985 */
1986 public static final int PAUSED = 5;
Andy Huange0b83b82012-03-06 19:57:04 -08001987
1988 private AttachmentState() {}
1989 }
1990
1991 public static final class AttachmentDestination {
1992
1993 /**
1994 * The attachment will be or is already saved to the app-private cache partition.
1995 */
1996 public static final int CACHE = 0;
1997 /**
1998 * The attachment will be or is already saved to external shared device storage.
Mark Wei5b49ce32013-02-08 16:31:16 -08001999 * This value should be 1 since saveToSd is often used in a similar way
Andy Huange0b83b82012-03-06 19:57:04 -08002000 */
2001 public static final int EXTERNAL = 1;
2002
2003 private AttachmentDestination() {}
2004 }
2005
Mindy Pereiraf30cc092011-12-29 14:02:40 -08002006 public static final class AttachmentColumns {
Andy Huange0b83b82012-03-06 19:57:04 -08002007 /**
2008 * This string column is the attachment's file name, intended for display in UI. It is not
2009 * the full path of the file.
2010 */
Paul Westbrookc97d8ac2012-03-23 15:21:48 -07002011 public static final String NAME = OpenableColumns.DISPLAY_NAME;
Andy Huange0b83b82012-03-06 19:57:04 -08002012 /**
2013 * This integer column is the file size of the attachment, in bytes.
2014 */
Paul Westbrookc97d8ac2012-03-23 15:21:48 -07002015 public static final String SIZE = OpenableColumns.SIZE;
Andy Huange0b83b82012-03-06 19:57:04 -08002016 /**
Mark Wei1aee17e2013-01-14 14:47:16 -08002017 * This column is a {@link android.net.Uri} that can be queried to
2018 * monitor download state and progress for this individual attachment
2019 * (resulting cursor has one single row for this attachment).
Andy Huange0b83b82012-03-06 19:57:04 -08002020 */
Mindy Pereira7a07fb42012-01-11 10:32:48 -08002021 public static final String URI = "uri";
Andy Huange0b83b82012-03-06 19:57:04 -08002022 /**
2023 * This string column is the MIME type of the attachment.
2024 */
Mindy Pereiraf30cc092011-12-29 14:02:40 -08002025 public static final String CONTENT_TYPE = "contentType";
Andy Huange0b83b82012-03-06 19:57:04 -08002026 /**
2027 * This integer column is the current downloading state of the
2028 * attachment as defined in {@link AttachmentState}.
2029 * <p>
Andy Huangd8e249e2012-03-21 17:01:37 -07002030 * Providers must accept updates to {@link #URI} with new values of
Andy Huange0b83b82012-03-06 19:57:04 -08002031 * this column to initiate or cancel downloads.
2032 */
2033 public static final String STATE = "state";
2034 /**
2035 * This integer column is the file destination for the current download
2036 * in progress (when {@link #STATE} is
2037 * {@link AttachmentState#DOWNLOADING}) or the resulting downloaded file
2038 * ( when {@link #STATE} is {@link AttachmentState#SAVED}), as defined
2039 * in {@link AttachmentDestination}. This value is undefined in any
2040 * other state.
2041 * <p>
Andy Huangd8e249e2012-03-21 17:01:37 -07002042 * Providers must accept updates to {@link #URI} with new values of
Andy Huange0b83b82012-03-06 19:57:04 -08002043 * this column to move an existing downloaded file.
2044 */
2045 public static final String DESTINATION = "destination";
2046 /**
2047 * This integer column is the current number of bytes downloaded when
2048 * {@link #STATE} is {@link AttachmentState#DOWNLOADING}. This value is
2049 * undefined in any other state.
2050 */
2051 public static final String DOWNLOADED_SIZE = "downloadedSize";
2052 /**
Mark Wei1aee17e2013-01-14 14:47:16 -08002053 * This column is a {@link android.net.Uri} that points to the
2054 * downloaded local file when {@link #STATE} is
2055 * {@link AttachmentState#SAVED}. This value is undefined in any other
2056 * state.
Andy Huange0b83b82012-03-06 19:57:04 -08002057 */
2058 public static final String CONTENT_URI = "contentUri";
2059 /**
Mark Wei1aee17e2013-01-14 14:47:16 -08002060 * This column is a {@link android.net.Uri} that points to a local
2061 * thumbnail file for the attachment. Providers that do not support
2062 * downloading attachment thumbnails may leave this null.
Andy Huange0b83b82012-03-06 19:57:04 -08002063 */
2064 public static final String THUMBNAIL_URI = "thumbnailUri";
2065 /**
Mark Wei1aee17e2013-01-14 14:47:16 -08002066 * This column is an {@link android.net.Uri} used in an
2067 * {@link android.content.Intent#ACTION_VIEW} Intent to launch a preview
2068 * activity that allows the user to efficiently view an attachment
2069 * without having to first download the entire file. Providers that do
2070 * not support previewing attachments may leave this null.
Andy Huange0b83b82012-03-06 19:57:04 -08002071 */
Paul Westbrookd49db8e2012-08-03 17:58:46 -07002072 public static final String PREVIEW_INTENT_URI = "previewIntentUri";
Mark Weibbe74ae2012-11-19 11:20:09 -08002073 /**
2074 * This column contains provider-specific private data as JSON string.
2075 */
2076 public static final String PROVIDER_DATA = "providerData";
Andy Huange0b83b82012-03-06 19:57:04 -08002077
Andrew Sapperstein7434e802013-06-21 11:26:49 -07002078 /**
Mark Weibeaf1e42013-08-05 17:52:48 -07002079 * This column represents whether this attachment supports the ability to be downloaded
2080 * again.
Andrew Sapperstein7434e802013-06-21 11:26:49 -07002081 */
2082 public static final String SUPPORTS_DOWNLOAD_AGAIN = "supportsDownloadAgain";
Mark Weibeaf1e42013-08-05 17:52:48 -07002083 /**
2084 * This column represents the visibility type of this attachment. One of the
2085 * {@link AttachmentType} constants.
2086 */
2087 public static final String TYPE = "type";
Andrew Sapperstein7434e802013-06-21 11:26:49 -07002088
Martin Hibdon519c2182013-09-20 17:27:57 -07002089 /**
2090 * This column holds various bitwise flags for status information.
2091 */
2092 public static final String FLAGS = "flags";
2093
James Lemieux934b1f42014-04-09 12:59:29 -07002094 /**
2095 * This column holds the RFC 2392 content id of the email part for this attachment, if
2096 * possible; otherwise it holds an identifier unique to the parent message.
2097 */
2098 public static final String CONTENT_ID = "contentId";
2099
Andy Huange0b83b82012-03-06 19:57:04 -08002100 private AttachmentColumns() {}
Mindy Pereiraf30cc092011-12-29 14:02:40 -08002101 }
Mindy Pereira013194c2012-01-06 15:09:33 -08002102
Mark Wei1aee17e2013-01-14 14:47:16 -08002103 public static final class AttachmentContentValueKeys {
2104 public static final String RENDITION = "rendition";
Mark Wei26745352013-01-17 21:40:34 -08002105 public static final String ADDITIONAL_PRIORITY = "additionalPriority";
2106 public static final String DELAY_DOWNLOAD = "delayDownload";
Mark Wei1aee17e2013-01-14 14:47:16 -08002107 }
2108
2109 /**
2110 * Indicates a version of an attachment.
2111 */
2112 public static final class AttachmentRendition {
2113
2114 /** A smaller or simpler version of the attachment, such as a scaled-down image or an HTML
2115 * version of a document. Not always available.
2116 */
2117 public static final int SIMPLE = 0;
2118 /**
2119 * The full version of an attachment if it can be handled on the device, otherwise the
2120 * preview.
2121 */
2122 public static final int BEST = 1;
2123
Mark Wei7df813e2013-03-12 15:11:17 -07002124 private static final String SIMPLE_STRING = "SIMPLE";
2125 private static final String BEST_STRING = "BEST";
2126
Mark Wei479505d2013-03-21 06:04:46 -07002127 /**
2128 * Prefer renditions in this order.
2129 */
2130 public static final int[] PREFERRED_RENDITIONS = new int[]{BEST, SIMPLE};
2131
Mark Wei1aee17e2013-01-14 14:47:16 -08002132 public static int parseRendition(String rendition) {
Mark Wei479505d2013-03-21 06:04:46 -07002133 if (TextUtils.equals(rendition, SIMPLE_STRING)) {
2134 return SIMPLE;
2135 } else if (TextUtils.equals(rendition, BEST_STRING)) {
2136 return BEST;
2137 }
2138
2139 throw new IllegalArgumentException(String.format("Unknown rendition %s", rendition));
Mark Wei1aee17e2013-01-14 14:47:16 -08002140 }
2141
2142 public static String toString(int rendition) {
Mark Wei479505d2013-03-21 06:04:46 -07002143 if (rendition == BEST) {
2144 return BEST_STRING;
2145 } else if (rendition == SIMPLE) {
2146 return SIMPLE_STRING;
2147 }
2148
2149 throw new IllegalArgumentException(String.format("Unknown rendition %d", rendition));
Mark Wei1aee17e2013-01-14 14:47:16 -08002150 }
2151 }
2152
Mark Weibeaf1e42013-08-05 17:52:48 -07002153 /**
2154 * Indicates the visibility type of an attachment.
2155 */
2156 public static final class AttachmentType {
2157 public static final int STANDARD = 0;
2158 public static final int INLINE_CURRENT_MESSAGE = 1;
2159 public static final int INLINE_QUOTED_MESSAGE = 2;
2160 }
2161
Marc Blankb31ab5a2012-02-01 12:28:29 -08002162 public static final String[] UNDO_PROJECTION = {
2163 ConversationColumns.MESSAGE_LIST_URI
2164 };
2165 public static final int UNDO_MESSAGE_LIST_COLUMN = 0;
Marc Blankdd10bc82012-02-01 19:10:46 -08002166
2167 // Parameter used to indicate the sequence number for an undoable operation
2168 public static final String SEQUENCE_QUERY_PARAMETER = "seq";
Paul Westbrook63eef792012-02-27 14:01:06 -08002169
Scott Kennedy1007e702012-12-20 11:18:45 -08002170 /**
2171 * Parameter used to force UI notifications in an operation involving
2172 * {@link ConversationOperations#OPERATION_KEY}.
2173 */
2174 public static final String FORCE_UI_NOTIFICATIONS_QUERY_PARAMETER = "forceUiNotifications";
2175
Scott Kennedydd2ec682013-06-03 19:16:13 -07002176 /**
2177 * Parameter used to allow returning hidden folders.
2178 */
2179 public static final String ALLOW_HIDDEN_FOLDERS_QUERY_PARAM = "allowHiddenFolders";
2180
Scott Kennedy0d0f8b02012-10-12 15:18:18 -07002181 public static final String AUTO_ADVANCE_MODE_OLDER = "older";
2182 public static final String AUTO_ADVANCE_MODE_NEWER = "newer";
2183 public static final String AUTO_ADVANCE_MODE_LIST = "list";
2184
Vikram Aggarwalc7694222012-04-23 13:37:01 -07002185 /**
2186 * Settings for auto advancing when the current conversation has been destroyed.
2187 */
Paul Westbrook63eef792012-02-27 14:01:06 -08002188 public static final class AutoAdvance {
Vikram Aggarwalc7694222012-04-23 13:37:01 -07002189 /** No setting specified. */
Paul Westbrook63eef792012-02-27 14:01:06 -08002190 public static final int UNSET = 0;
Vikram Aggarwalc7694222012-04-23 13:37:01 -07002191 /** Go to the older message (if available) */
Paul Westbrook63eef792012-02-27 14:01:06 -08002192 public static final int OLDER = 1;
Vikram Aggarwalc7694222012-04-23 13:37:01 -07002193 /** Go to the newer message (if available) */
Paul Westbrook63eef792012-02-27 14:01:06 -08002194 public static final int NEWER = 2;
Vikram Aggarwalc7694222012-04-23 13:37:01 -07002195 /** Go back to conversation list*/
Paul Westbrook63eef792012-02-27 14:01:06 -08002196 public static final int LIST = 3;
Vikram Aggarwal82d37502013-01-10 16:18:49 -08002197 /** The default option is to go to the list */
2198 public static final int DEFAULT = LIST;
Scott Kennedy0d0f8b02012-10-12 15:18:18 -07002199
2200 /**
2201 * Gets the int value for the given auto advance setting.
2202 *
2203 * @param autoAdvanceSetting The string setting, such as "newer", "older", "list"
2204 */
2205 public static int getAutoAdvanceInt(final String autoAdvanceSetting) {
2206 final int autoAdvance;
2207
2208 if (AUTO_ADVANCE_MODE_NEWER.equals(autoAdvanceSetting)) {
Andy Huange6c9fb62013-11-15 09:56:20 -08002209 autoAdvance = NEWER;
Scott Kennedy0d0f8b02012-10-12 15:18:18 -07002210 } else if (AUTO_ADVANCE_MODE_OLDER.equals(autoAdvanceSetting)) {
Andy Huange6c9fb62013-11-15 09:56:20 -08002211 autoAdvance = OLDER;
Scott Kennedy0d0f8b02012-10-12 15:18:18 -07002212 } else if (AUTO_ADVANCE_MODE_LIST.equals(autoAdvanceSetting)) {
Andy Huange6c9fb62013-11-15 09:56:20 -08002213 autoAdvance = LIST;
Scott Kennedy0d0f8b02012-10-12 15:18:18 -07002214 } else {
Andy Huange6c9fb62013-11-15 09:56:20 -08002215 autoAdvance = UNSET;
Scott Kennedy0d0f8b02012-10-12 15:18:18 -07002216 }
2217
2218 return autoAdvance;
2219 }
Andy Huange6c9fb62013-11-15 09:56:20 -08002220
2221 public static String getAutoAdvanceStr(int autoAdvance) {
2222 final String str;
2223
2224 switch (autoAdvance) {
2225 case OLDER:
2226 str = AUTO_ADVANCE_MODE_OLDER;
2227 break;
2228 case NEWER:
2229 str = AUTO_ADVANCE_MODE_NEWER;
2230 break;
2231 case LIST:
2232 str = AUTO_ADVANCE_MODE_LIST;
2233 break;
2234 default:
2235 str = "unset";
2236 break;
2237 }
2238
2239 return str;
2240 }
Paul Westbrook63eef792012-02-27 14:01:06 -08002241 }
2242
Mindy Pereira71a8f5e2012-07-25 14:33:18 -07002243 /**
2244 * Settings for what swipe should do.
2245 */
2246 public static final class Swipe {
2247 /** Archive or remove label, if available. */
2248 public static final int ARCHIVE = 0;
2249 /** Delete */
2250 public static final int DELETE = 1;
2251 /** No swipe */
2252 public static final int DISABLED = 2;
Mindy Pereirae58222b2012-07-25 14:33:18 -07002253 /** Default is delete */
Mindy Pereira1c605fe2012-07-25 16:17:15 -07002254 public static final int DEFAULT = ARCHIVE;
Mindy Pereira71a8f5e2012-07-25 14:33:18 -07002255 }
2256
Paul Westbrookfa255c02012-10-13 14:32:52 -07002257 /**
2258 * Settings for Conversation view mode.
2259 */
2260 public static final class ConversationViewMode {
2261 /**
2262 * The user hasn't specified a mode.
2263 */
2264 public static final int UNDEFINED = -1;
2265 /**
2266 * Default to fit the conversation to screen view
2267 */
2268 public static final int OVERVIEW = 0;
2269 /**
2270 * Conversation text size should be the device default, and wide conversations may
2271 * require panning
2272 */
2273 public static final int READING = 1;
Andy Huangccf67802013-03-15 14:31:57 -07002274 public static final int DEFAULT = OVERVIEW;
Paul Westbrookfa255c02012-10-13 14:32:52 -07002275 }
2276
Paul Westbrook63eef792012-02-27 14:01:06 -08002277 public static final class SnapHeaderValue {
2278 public static final int ALWAYS = 0;
2279 public static final int PORTRAIT_ONLY = 1;
2280 public static final int NEVER = 2;
2281 }
2282
2283 public static final class MessageTextSize {
2284 public static final int TINY = -2;
2285 public static final int SMALL = -1;
2286 public static final int NORMAL = 0;
2287 public static final int LARGE = 1;
2288 public static final int HUGE = 2;
2289 }
2290
2291 public static final class DefaultReplyBehavior {
2292 public static final int REPLY = 0;
2293 public static final int REPLY_ALL = 1;
2294 }
2295
Paul Westbrookee0fda72012-03-19 10:13:36 -07002296 /**
Alice Yang4758e982013-04-24 20:31:34 -07002297 * Setting for whether to show sender images in conversation list.
Alice Yang64273142013-04-10 18:26:56 -07002298 */
2299 public static final class ConversationListIcon {
Alice Yang64273142013-04-10 18:26:56 -07002300 public static final int SENDER_IMAGE = 1;
2301 public static final int NONE = 2;
Alice Yangf5ffaee2013-04-23 16:23:10 -07002302 public static final int DEFAULT = 1; // Default to show sender image
Alice Yang64273142013-04-10 18:26:56 -07002303 }
2304
2305 /**
Marc Blankbc6ba052012-03-19 10:46:07 -07002306 * Action for an intent used to update/create new notifications. The mime type of this
Paul Westbrookee0fda72012-03-19 10:13:36 -07002307 * intent should be set to the mimeType of the account that is generating this notification.
2308 * An intent of this action is required to have the following extras:
Andy Huangd8e249e2012-03-21 17:01:37 -07002309 * {@link UpdateNotificationExtras#EXTRA_FOLDER} {@link UpdateNotificationExtras#EXTRA_ACCOUNT}
Paul Westbrookee0fda72012-03-19 10:13:36 -07002310 */
2311 public static final String ACTION_UPDATE_NOTIFICATION =
2312 "com.android.mail.action.update_notification";
2313
Marc Blankbc6ba052012-03-19 10:46:07 -07002314 public static final class UpdateNotificationExtras {
2315 /**
Paul Westbrook6ead20d2012-03-19 14:48:14 -07002316 * Parcelable extra containing a {@link Uri} to a {@link Folder}
Marc Blankbc6ba052012-03-19 10:46:07 -07002317 */
2318 public static final String EXTRA_FOLDER = "notification_extra_folder";
Paul Westbrookee0fda72012-03-19 10:13:36 -07002319
Marc Blankbc6ba052012-03-19 10:46:07 -07002320 /**
Paul Westbrook6ead20d2012-03-19 14:48:14 -07002321 * Parcelable extra containing a {@link Uri} to an {@link Account}
Marc Blankbc6ba052012-03-19 10:46:07 -07002322 */
2323 public static final String EXTRA_ACCOUNT = "notification_extra_account";
Paul Westbrook6ead20d2012-03-19 14:48:14 -07002324
2325 /**
2326 * Integer extra containing the update unread count for the account/folder.
2327 * If this value is 0, the UI will not block the intent to allow code to clear notifications
2328 * to run.
2329 */
2330 public static final String EXTRA_UPDATED_UNREAD_COUNT = "notification_updated_unread_count";
Tony Mantler81d00562013-11-21 12:26:01 -08002331
2332 /**
2333 * Integer extra containing the update unseen count for the account/folder.
2334 */
2335 public static final String EXTRA_UPDATED_UNSEEN_COUNT = "notification_updated_unseen_count";
Marc Blankbc6ba052012-03-19 10:46:07 -07002336 }
Paul Westbrooke5503552012-03-28 00:35:57 -07002337
2338 public static final class EditSettingsExtras {
2339 /**
2340 * Parcelable extra containing account for which the user wants to
2341 * modify settings
2342 */
2343 public static final String EXTRA_ACCOUNT = "extra_account";
2344
2345 /**
2346 * Parcelable extra containing folder for which the user wants to
2347 * modify settings
2348 */
2349 public static final String EXTRA_FOLDER = "extra_folder";
Paul Westbrook18babd22012-04-09 22:17:08 -07002350
2351 /**
2352 * Boolean extra which is set true if the user wants to "manage folders"
2353 */
2354 public static final String EXTRA_MANAGE_FOLDERS = "extra_manage_folders";
Paul Westbrooke5503552012-03-28 00:35:57 -07002355 }
Paul Westbrook17beb0b2012-08-20 13:34:37 -07002356
2357 public static final class SendFeedbackExtras {
2358 /**
2359 * Optional boolean extras which indicates that the user is reporting a problem.
2360 */
2361 public static final String EXTRA_REPORTING_PROBLEM = "reporting_problem";
Paul Westbrook83e6b572013-02-05 16:22:42 -08002362 /**
2363 * Optional Parcelable extra containing the screenshot of the screen where the user
2364 * is reporting a problem.
2365 */
2366 public static final String EXTRA_SCREEN_SHOT = "screen_shot";
Paul Westbrook17beb0b2012-08-20 13:34:37 -07002367 }
Mark Wei9982fdb2012-08-30 18:27:46 -07002368
2369 public static final class ViewProxyExtras {
2370 /**
2371 * Uri extra passed to the proxy which indicates the original Uri that was intended to be
2372 * viewed.
2373 */
2374 public static final String EXTRA_ORIGINAL_URI = "original_uri";
2375 /**
Andrew Sapperstein65f252a2014-04-02 16:48:16 -07002376 * String extra passed to the proxy which indicates the account being viewed.
Mark Wei9982fdb2012-08-30 18:27:46 -07002377 */
Andrew Sapperstein65f252a2014-04-02 16:48:16 -07002378 public static final String EXTRA_ACCOUNT_NAME = "account_name";
Mark Wei9982fdb2012-08-30 18:27:46 -07002379 /**
2380 * String extra passed from the proxy which indicates the salt used to generate the digest.
2381 */
2382 public static final String EXTRA_SALT = "salt";
2383 /**
2384 * Byte[] extra passed from the proxy which indicates the digest of the salted account name.
2385 */
2386 public static final String EXTRA_ACCOUNT_DIGEST = "digest";
2387 }
Paul Westbrook82ea6da2011-12-15 11:03:51 -08002388}