Vikram Aggarwal | 4f9a4c5 | 2012-01-11 15:04:55 -0800 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (C) 2011 Google Inc. |
| 3 | * Licensed to The Android Open Source Project. |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 4 | * |
Vikram Aggarwal | 4f9a4c5 | 2012-01-11 15:04:55 -0800 | [diff] [blame] | 5 | * 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 Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 8 | * |
Vikram Aggarwal | 4f9a4c5 | 2012-01-11 15:04:55 -0800 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 10 | * |
Vikram Aggarwal | 4f9a4c5 | 2012-01-11 15:04:55 -0800 | [diff] [blame] | 11 | * 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 Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 17 | |
Andy Huang | 30e2c24 | 2012-01-06 18:14:30 -0800 | [diff] [blame] | 18 | package com.android.mail.providers; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 19 | |
Alice Yang | 6427314 | 2013-04-10 18:26:56 -0700 | [diff] [blame] | 20 | import android.content.ContentProvider; |
| 21 | import android.content.ContentValues; |
Andy Huang | d521baf | 2013-05-21 18:08:08 -0700 | [diff] [blame] | 22 | import android.database.Cursor; |
Alice Yang | 6427314 | 2013-04-10 18:26:56 -0700 | [diff] [blame] | 23 | import android.net.Uri; |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 24 | import android.os.Bundle; |
Andy Huang | d521baf | 2013-05-21 18:08:08 -0700 | [diff] [blame] | 25 | import android.os.Parcelable; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 26 | import android.provider.BaseColumns; |
Paul Westbrook | c97d8ac | 2012-03-23 15:21:48 -0700 | [diff] [blame] | 27 | import android.provider.OpenableColumns; |
Mindy Pereira | 82cc566 | 2012-01-09 17:29:30 -0800 | [diff] [blame] | 28 | import android.text.TextUtils; |
| 29 | |
Tony Mantler | 42fe486 | 2013-10-23 11:39:19 -0700 | [diff] [blame] | 30 | import com.google.common.collect.ImmutableList; |
Alice Yang | 6427314 | 2013-04-10 18:26:56 -0700 | [diff] [blame] | 31 | import com.google.common.collect.ImmutableMap; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 32 | |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 33 | import java.util.Map; |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 34 | import java.util.regex.Pattern; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 35 | |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 36 | public class UIProvider { |
Mindy Pereira | 048b5c8 | 2012-04-02 11:11:33 -0700 | [diff] [blame] | 37 | public static final String EMAIL_SEPARATOR = ","; |
Mindy Pereira | 326c660 | 2012-01-04 15:32:42 -0800 | [diff] [blame] | 38 | public static final long INVALID_CONVERSATION_ID = -1; |
| 39 | public static final long INVALID_MESSAGE_ID = -1; |
| 40 | |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 41 | /** |
| 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 Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 46 | /** |
| 47 | * No sync in progress |
| 48 | */ |
Paul Westbrook | c808fac | 2012-02-22 16:42:18 -0800 | [diff] [blame] | 49 | public static final int NO_SYNC = 0; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 50 | /** |
| 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 Westbrook | c808fac | 2012-02-22 16:42:18 -0800 | [diff] [blame] | 54 | public static final int USER_REFRESH = 1<<0; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 55 | /** |
| 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 Westbrook | c808fac | 2012-02-22 16:42:18 -0800 | [diff] [blame] | 62 | public static final int USER_QUERY = 1<<1; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 63 | /** |
| 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 Westbrook | dfa1dec | 2012-09-26 16:27:28 -0700 | [diff] [blame] | 77 | /** |
| 78 | * Account initialization is required. |
| 79 | */ |
| 80 | public static final int ACCOUNT_INITIALIZATION_REQUIRED = 1<<5; |
Mindy Pereira | 70a70c9 | 2012-08-02 08:39:45 -0700 | [diff] [blame] | 81 | |
| 82 | public static boolean isSyncInProgress(int syncStatus) { |
| 83 | return 0 != (syncStatus & (BACKGROUND_SYNC | |
| 84 | USER_REFRESH | |
Vikram Aggarwal | d31f0cf | 2013-01-18 15:34:40 -0800 | [diff] [blame] | 85 | LIVE_QUERY)); |
Mindy Pereira | 70a70c9 | 2012-08-02 08:39:45 -0700 | [diff] [blame] | 86 | } |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Values for the result of the last attempted sync of a Folder/Account |
| 91 | */ |
| 92 | public static final class LastSyncResult { |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 93 | /** The sync completed successfully */ |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 94 | public static final int SUCCESS = 0; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 95 | /** The sync wasn't completed due to a connection error */ |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 96 | public static final int CONNECTION_ERROR = 1; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 97 | /** The sync wasn't completed due to an authentication error */ |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 98 | public static final int AUTH_ERROR = 2; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 99 | /** The sync wasn't completed due to a security error */ |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 100 | public static final int SECURITY_ERROR = 3; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 101 | /** The sync wasn't completed due to a low memory condition */ |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 102 | public static final int STORAGE_ERROR = 4; |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 103 | /** The sync wasn't completed due to an internal error/exception */ |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 104 | public static final int INTERNAL_ERROR = 5; |
| 105 | } |
| 106 | |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 107 | // The actual content provider should define its own authority |
Andy Huang | 30e2c24 | 2012-01-06 18:14:30 -0800 | [diff] [blame] | 108 | public static final String AUTHORITY = "com.android.mail.providers"; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 109 | |
| 110 | public static final String ACCOUNT_LIST_TYPE = |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 111 | "vnd.android.cursor.dir/vnd.com.android.mail.account"; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 112 | public static final String ACCOUNT_TYPE = |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 113 | "vnd.android.cursor.item/vnd.com.android.mail.account"; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 114 | |
Paul Westbrook | 2d82d61 | 2012-03-07 09:21:14 -0800 | [diff] [blame] | 115 | /** |
| 116 | * Query parameter key that can be used to control the behavior of list queries. The value |
| 117 | * must be a serialized {@link ListParams} object. UIProvider implementations are not |
| 118 | * required to respect this query parameter |
| 119 | */ |
| 120 | public static final String LIST_PARAMS_QUERY_PARAMETER = "listParams"; |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 121 | public static final String LABEL_QUERY_PARAMETER = "label"; |
| 122 | public static final String SEEN_QUERY_PARAMETER = "seen"; |
Paul Westbrook | 2d82d61 | 2012-03-07 09:21:14 -0800 | [diff] [blame] | 123 | |
Scott Kennedy | 41c1694 | 2013-07-11 17:16:28 -0700 | [diff] [blame] | 124 | /** |
| 125 | * Query parameter that can be used to specify a parent for a the returned folder object from a |
| 126 | * query. When set, if a folder is returned that does not have a true parent, it will use this |
| 127 | * uri as its parent uri. |
| 128 | */ |
| 129 | public static final String DEFAULT_PARENT_QUERY_PARAMETER = "defaultParent"; |
| 130 | |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 131 | public static final Map<String, Class<?>> ACCOUNTS_COLUMNS_NO_CAPABILITIES = |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 132 | new ImmutableMap.Builder<String, Class<?>>() |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 133 | .put(AccountColumns._ID, Integer.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 134 | .put(AccountColumns.NAME, String.class) |
Tony Mantler | bb036ff7 | 2013-10-18 14:03:43 -0700 | [diff] [blame] | 135 | .put(AccountColumns.SENDER_NAME, String.class) |
Tony Mantler | 3e16687 | 2013-09-24 16:39:18 -0700 | [diff] [blame] | 136 | .put(AccountColumns.ACCOUNT_MANAGER_NAME, String.class) |
Scott Kennedy | e588380 | 2013-04-14 14:33:20 -0700 | [diff] [blame] | 137 | .put(AccountColumns.TYPE, String.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 138 | .put(AccountColumns.PROVIDER_VERSION, Integer.class) |
| 139 | .put(AccountColumns.URI, String.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 140 | .put(AccountColumns.FOLDER_LIST_URI, String.class) |
| 141 | .put(AccountColumns.FULL_FOLDER_LIST_URI, String.class) |
Tony Mantler | 009f1b5 | 2013-09-20 14:32:23 -0700 | [diff] [blame] | 142 | .put(AccountColumns.ALL_FOLDER_LIST_URI, String.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 143 | .put(AccountColumns.SEARCH_URI, String.class) |
| 144 | .put(AccountColumns.ACCOUNT_FROM_ADDRESSES, String.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 145 | .put(AccountColumns.EXPUNGE_MESSAGE_URI, String.class) |
| 146 | .put(AccountColumns.UNDO_URI, String.class) |
| 147 | .put(AccountColumns.SETTINGS_INTENT_URI, String.class) |
| 148 | .put(AccountColumns.SYNC_STATUS, Integer.class) |
| 149 | .put(AccountColumns.HELP_INTENT_URI, String.class) |
| 150 | .put(AccountColumns.SEND_FEEDBACK_INTENT_URI, String.class) |
| 151 | .put(AccountColumns.REAUTHENTICATION_INTENT_URI, String.class) |
| 152 | .put(AccountColumns.COMPOSE_URI, String.class) |
| 153 | .put(AccountColumns.MIME_TYPE, String.class) |
| 154 | .put(AccountColumns.RECENT_FOLDER_LIST_URI, String.class) |
| 155 | .put(AccountColumns.COLOR, Integer.class) |
| 156 | .put(AccountColumns.DEFAULT_RECENT_FOLDER_LIST_URI, String.class) |
| 157 | .put(AccountColumns.MANUAL_SYNC_URI, String.class) |
| 158 | .put(AccountColumns.VIEW_INTENT_PROXY_URI, String.class) |
| 159 | .put(AccountColumns.ACCOUNT_COOKIE_QUERY_URI, String.class) |
| 160 | .put(AccountColumns.SettingsColumns.SIGNATURE, String.class) |
| 161 | .put(AccountColumns.SettingsColumns.AUTO_ADVANCE, Integer.class) |
| 162 | .put(AccountColumns.SettingsColumns.MESSAGE_TEXT_SIZE, Integer.class) |
| 163 | .put(AccountColumns.SettingsColumns.SNAP_HEADERS, Integer.class) |
| 164 | .put(AccountColumns.SettingsColumns.REPLY_BEHAVIOR, Integer.class) |
Scott Kennedy | 251d6c4 | 2013-04-23 16:46:24 -0700 | [diff] [blame] | 165 | .put(AccountColumns.SettingsColumns.CONV_LIST_ICON, Integer.class) |
Mark Wei | aa76bdf | 2013-08-06 18:20:11 -0700 | [diff] [blame] | 166 | .put(AccountColumns.SettingsColumns.CONV_LIST_ATTACHMENT_PREVIEWS, Integer.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 167 | .put(AccountColumns.SettingsColumns.CONFIRM_DELETE, Integer.class) |
| 168 | .put(AccountColumns.SettingsColumns.CONFIRM_ARCHIVE, Integer.class) |
| 169 | .put(AccountColumns.SettingsColumns.CONFIRM_SEND, Integer.class) |
| 170 | .put(AccountColumns.SettingsColumns.DEFAULT_INBOX, String.class) |
| 171 | .put(AccountColumns.SettingsColumns.DEFAULT_INBOX_NAME, String.class) |
| 172 | .put(AccountColumns.SettingsColumns.FORCE_REPLY_FROM_DEFAULT, Integer.class) |
| 173 | .put(AccountColumns.SettingsColumns.MAX_ATTACHMENT_SIZE, Integer.class) |
| 174 | .put(AccountColumns.SettingsColumns.SWIPE, Integer.class) |
| 175 | .put(AccountColumns.SettingsColumns.PRIORITY_ARROWS_ENABLED, Integer.class) |
| 176 | .put(AccountColumns.SettingsColumns.SETUP_INTENT_URI, String.class) |
| 177 | .put(AccountColumns.SettingsColumns.CONVERSATION_VIEW_MODE, Integer.class) |
Vikram Aggarwal | 69a6cdf | 2013-01-08 16:05:17 -0800 | [diff] [blame] | 178 | .put(AccountColumns.SettingsColumns.VEILED_ADDRESS_PATTERN, String.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 179 | .put(AccountColumns.UPDATE_SETTINGS_URI, String.class) |
Alice Yang | 3617b41 | 2013-05-10 00:30:07 -0700 | [diff] [blame] | 180 | .put(AccountColumns.ENABLE_MESSAGE_TRANSFORMS, Integer.class) |
Alice Yang | c86b1fb | 2013-08-11 22:27:25 -0700 | [diff] [blame] | 181 | .put(AccountColumns.SYNC_AUTHORITY, String.class) |
Tony Mantler | 59e6909 | 2013-08-14 11:05:00 -0700 | [diff] [blame] | 182 | .put(AccountColumns.QUICK_RESPONSE_URI, String.class) |
Scott Kennedy | dd2ec68 | 2013-06-03 19:16:13 -0700 | [diff] [blame] | 183 | .put(AccountColumns.SettingsColumns.MOVE_TO_INBOX, String.class) |
Alice Yang | f323c04 | 2013-10-30 00:15:02 -0700 | [diff] [blame] | 184 | .put(AccountColumns.SettingsColumns.SHOW_IMAGES, Integer.class) |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 185 | .build(); |
| 186 | |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 187 | public static final Map<String, Class<?>> ACCOUNTS_COLUMNS = |
| 188 | new ImmutableMap.Builder<String, Class<?>>() |
| 189 | .putAll(ACCOUNTS_COLUMNS_NO_CAPABILITIES) |
| 190 | .put(AccountColumns.CAPABILITIES, Integer.class) |
| 191 | .build(); |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 192 | |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 193 | // pull out the keyset from above to form the projection |
| 194 | public static final String[] ACCOUNTS_PROJECTION = |
| 195 | ACCOUNTS_COLUMNS.keySet().toArray(new String[ACCOUNTS_COLUMNS.size()]); |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 196 | |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 197 | public static final |
| 198 | String[] ACCOUNTS_PROJECTION_NO_CAPABILITIES = ACCOUNTS_COLUMNS_NO_CAPABILITIES.keySet() |
| 199 | .toArray(new String[ACCOUNTS_COLUMNS_NO_CAPABILITIES.size()]); |
Scott Kennedy | 0d0f8b0 | 2012-10-12 15:18:18 -0700 | [diff] [blame] | 200 | |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 201 | public static final class AccountCapabilities { |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 202 | /** |
| 203 | * Whether folders can be synchronized back to the server. |
| 204 | */ |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 205 | public static final int SYNCABLE_FOLDERS = 0x0001; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 206 | /** |
| 207 | * Whether the server allows reporting spam back. |
| 208 | */ |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 209 | public static final int REPORT_SPAM = 0x0002; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 210 | /** |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 211 | * Whether the server allows reporting phishing back. |
| 212 | */ |
| 213 | public static final int REPORT_PHISHING = 0x0004; |
| 214 | /** |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 215 | * Whether the server supports a concept of Archive: removing mail from the Inbox but |
| 216 | * keeping it around. |
| 217 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 218 | public static final int ARCHIVE = 0x0008; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 219 | /** |
| 220 | * Whether the server will stop notifying on updates to this thread? This requires |
| 221 | * THREADED_CONVERSATIONS to be true, otherwise it should be ignored. |
| 222 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 223 | public static final int MUTE = 0x0010; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 224 | /** |
| 225 | * Whether the server supports searching over all messages. This requires SYNCABLE_FOLDERS |
| 226 | * to be true, otherwise it should be ignored. |
| 227 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 228 | public static final int SERVER_SEARCH = 0x0020; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 229 | /** |
| 230 | * Whether the server supports constraining search to a single folder. Requires |
| 231 | * SYNCABLE_FOLDERS, otherwise it should be ignored. |
| 232 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 233 | public static final int FOLDER_SERVER_SEARCH = 0x0040; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 234 | /** |
| 235 | * Whether the server sends us sanitized HTML (guaranteed to not contain malicious HTML). |
| 236 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 237 | public static final int SANITIZED_HTML = 0x0080; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 238 | /** |
| 239 | * Whether the server allows synchronization of draft messages. This does NOT require |
| 240 | * SYNCABLE_FOLDERS to be set. |
| 241 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 242 | public static final int DRAFT_SYNCHRONIZATION = 0x0100; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 243 | /** |
| 244 | * Does the server allow the user to compose mails (and reply) using addresses other than |
| 245 | * their account name? For instance, GMail allows users to set FROM addresses that are |
| 246 | * different from account@gmail.com address. For instance, user@gmail.com could have another |
| 247 | * FROM: address like user@android.com. If the user has enabled multiple FROM address, he |
| 248 | * can compose (and reply) using either address. |
| 249 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 250 | public static final int MULTIPLE_FROM_ADDRESSES = 0x0200; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 251 | /** |
| 252 | * Whether the server allows the original message to be included in the reply by setting a |
| 253 | * flag on the reply. If we can avoid including the entire previous message, we save on |
| 254 | * bandwidth (replies are shorter). |
| 255 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 256 | public static final int SMART_REPLY = 0x0400; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 257 | /** |
| 258 | * Does this account support searching locally, on the device? This requires the backend |
| 259 | * storage to support a mechanism for searching. |
| 260 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 261 | public static final int LOCAL_SEARCH = 0x0800; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 262 | /** |
| 263 | * Whether the server supports a notion of threaded conversations: where replies to messages |
| 264 | * are tagged to keep conversations grouped. This could be full threading (each message |
| 265 | * lists its parent) or conversation-level threading (each message lists one conversation |
| 266 | * which it belongs to) |
| 267 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 268 | public static final int THREADED_CONVERSATIONS = 0x1000; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 269 | /** |
| 270 | * Whether the server supports allowing a conversation to be in multiple folders. (Or allows |
Mindy Pereira | 30fd47b | 2012-03-09 09:24:00 -0800 | [diff] [blame] | 271 | * multiple folders on a single conversation) |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 272 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 273 | public static final int MULTIPLE_FOLDERS_PER_CONV = 0x2000; |
Mindy Pereira | 343ffeb | 2012-02-22 10:12:14 -0800 | [diff] [blame] | 274 | /** |
| 275 | * Whether the provider supports undoing operations. If it doesn't, never show the undo bar. |
| 276 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 277 | public static final int UNDO = 0x4000; |
Paul Westbrook | 94e440d | 2012-02-24 11:03:47 -0800 | [diff] [blame] | 278 | /** |
| 279 | * Whether the account provides help content. |
| 280 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 281 | public static final int HELP_CONTENT = 0x8000; |
Mindy Pereira | 7f0a962 | 2012-02-29 15:00:34 -0800 | [diff] [blame] | 282 | /** |
Paul Westbrook | 517743e | 2012-03-22 10:40:46 -0700 | [diff] [blame] | 283 | * Whether the account provides a way to send feedback content. |
| 284 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 285 | public static final int SEND_FEEDBACK = 0x10000; |
Paul Westbrook | 517743e | 2012-03-22 10:40:46 -0700 | [diff] [blame] | 286 | /** |
Mindy Pereira | 7f0a962 | 2012-02-29 15:00:34 -0800 | [diff] [blame] | 287 | * Whether the account provides a mechanism for marking conversations as important. |
| 288 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 289 | public static final int MARK_IMPORTANT = 0x20000; |
Marc Blank | 5114494 | 2012-03-20 13:59:32 -0700 | [diff] [blame] | 290 | /** |
| 291 | * Whether initial conversation queries should use a limit parameter |
| 292 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 293 | public static final int INITIAL_CONVERSATION_LIMIT = 0x40000; |
Marc Blank | d370792 | 2012-04-24 11:51:50 -0700 | [diff] [blame] | 294 | /** |
| 295 | * Whether the account cannot be used for sending |
| 296 | */ |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 297 | public static final int SENDING_UNAVAILABLE = 0x80000; |
Paul Westbrook | ef36254 | 2012-08-27 14:53:32 -0700 | [diff] [blame] | 298 | /** |
| 299 | * Whether the account supports discarding drafts from a conversation. This should be |
| 300 | * removed when all providers support this capability |
| 301 | */ |
| 302 | public static final int DISCARD_CONVERSATION_DRAFTS = 0x100000; |
Scott Kennedy | 7ee089e | 2013-03-25 17:05:44 -0400 | [diff] [blame] | 303 | /** |
| 304 | * Whether the account supports emptying the trash folder |
| 305 | */ |
| 306 | public static final int EMPTY_TRASH = 0x200000; |
| 307 | /** |
| 308 | * Whether the account supports emptying the spam folder |
| 309 | */ |
| 310 | public static final int EMPTY_SPAM = 0x400000; |
Scott Kennedy | 0e8dc84 | 2013-09-10 11:13:53 -0700 | [diff] [blame] | 311 | /** |
| 312 | * Whether the account supports nested folders |
| 313 | */ |
| 314 | public static final int NESTED_FOLDERS = 0x800000; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 315 | } |
| 316 | |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 317 | public static final class AccountColumns implements BaseColumns { |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 318 | /** |
| 319 | * This string column contains the human visible name for the account. |
| 320 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 321 | public static final String NAME = "name"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 322 | |
| 323 | /** |
Tony Mantler | bb036ff7 | 2013-10-18 14:03:43 -0700 | [diff] [blame] | 324 | * This string column contains the real name associated with the account, e.g. "John Doe" |
| 325 | */ |
| 326 | public static final String SENDER_NAME = "senderName"; |
| 327 | |
| 328 | /** |
Tony Mantler | 3e16687 | 2013-09-24 16:39:18 -0700 | [diff] [blame] | 329 | * This string column contains the account manager name of this account. |
| 330 | */ |
| 331 | |
| 332 | public static final String ACCOUNT_MANAGER_NAME = "accountManagerName"; |
| 333 | |
| 334 | /** |
Vikram Aggarwal | 6dde178 | 2012-03-12 17:16:48 -0700 | [diff] [blame] | 335 | * This integer contains the type of the account: Google versus non google. This is not |
| 336 | * returned by the UIProvider, rather this is a notion in the system. |
| 337 | */ |
| 338 | public static final String TYPE = "type"; |
| 339 | |
| 340 | /** |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 341 | * This integer column returns the version of the UI provider schema from which this |
| 342 | * account provider will return results. |
| 343 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 344 | public static final String PROVIDER_VERSION = "providerVersion"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 345 | |
| 346 | /** |
| 347 | * This string column contains the uri to directly access the information for this account. |
| 348 | */ |
Mindy Pereira | 6349a04 | 2012-01-04 11:25:01 -0800 | [diff] [blame] | 349 | public static final String URI = "accountUri"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 350 | |
| 351 | /** |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 352 | * This integer column contains a bit field of the possible capabilities that this account |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 353 | * supports. |
| 354 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 355 | public static final String CAPABILITIES = "capabilities"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 356 | |
| 357 | /** |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 358 | * This string column contains the content provider uri to return the |
| 359 | * list of top level folders for this account. |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 360 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 361 | public static final String FOLDER_LIST_URI = "folderListUri"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 362 | |
| 363 | /** |
Mindy Pereira | 31d7967 | 2012-06-26 14:43:09 -0700 | [diff] [blame] | 364 | * This string column contains the content provider uri to return the |
Tony Mantler | 009f1b5 | 2013-09-20 14:32:23 -0700 | [diff] [blame] | 365 | * list of all real folders for this account. |
Mindy Pereira | 31d7967 | 2012-06-26 14:43:09 -0700 | [diff] [blame] | 366 | */ |
| 367 | public static final String FULL_FOLDER_LIST_URI = "fullFolderListUri"; |
| 368 | |
| 369 | /** |
Tony Mantler | 009f1b5 | 2013-09-20 14:32:23 -0700 | [diff] [blame] | 370 | * This string column contains the content provider uri to return the |
| 371 | * list of all real and synthetic folders for this account. |
| 372 | */ |
| 373 | public static final String ALL_FOLDER_LIST_URI = "allFolderListUri"; |
| 374 | |
| 375 | /** |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 376 | * This string column contains the content provider uri that can be queried for search |
| 377 | * results. |
Paul Westbrook | 8130e6f | 2012-03-06 13:51:01 -0800 | [diff] [blame] | 378 | * The supported query parameters are limited to those listed |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 379 | * in {@link SearchQueryParameters} |
Paul Westbrook | 1475a7a | 2012-03-08 15:06:27 -0800 | [diff] [blame] | 380 | * The cursor returned from this query is expected have one row, where the columnm are a |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 381 | * subset of the columns specified in {@link FolderColumns} |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 382 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 383 | public static final String SEARCH_URI = "searchUri"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 384 | |
| 385 | /** |
Mindy Pereira | 92551d0 | 2012-04-05 11:31:12 -0700 | [diff] [blame] | 386 | * This string column contains a json array of json objects representing |
| 387 | * custom from addresses for this account or null if there are none. |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 388 | */ |
Mindy Pereira | 92551d0 | 2012-04-05 11:31:12 -0700 | [diff] [blame] | 389 | public static final String ACCOUNT_FROM_ADDRESSES = "accountFromAddresses"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 390 | |
| 391 | /** |
Mindy Pereira | 82cc566 | 2012-01-09 17:29:30 -0800 | [diff] [blame] | 392 | * This string column contains the content provider uri that can be used |
| 393 | * to expunge a message from this account. NOTE: This might be better to |
| 394 | * be an update operation on the messageUri. |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 395 | * When {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[])} |
| 396 | * is called with this uri, the {@link ContentValues} object is expected to have |
| 397 | * {@link BaseColumns#_ID} specified with the local message id of the message. |
Mindy Pereira | 82cc566 | 2012-01-09 17:29:30 -0800 | [diff] [blame] | 398 | */ |
| 399 | public static final String EXPUNGE_MESSAGE_URI = "expungeMessageUri"; |
Mindy Pereira | 96b5c35 | 2012-02-01 11:33:40 -0800 | [diff] [blame] | 400 | |
| 401 | /** |
| 402 | * This string column contains the content provider uri that can be used |
| 403 | * to undo the last committed action. |
| 404 | */ |
Mindy Pereira | 9600dac | 2012-02-17 15:59:25 -0800 | [diff] [blame] | 405 | public static final String UNDO_URI = "undoUri"; |
Paul Westbrook | 2861b6a | 2012-02-15 15:25:34 -0800 | [diff] [blame] | 406 | |
| 407 | /** |
Paul Westbrook | 9912eee | 2012-02-22 14:49:03 -0800 | [diff] [blame] | 408 | * Uri for EDIT intent that will cause the settings screens for this account type to be |
Paul Westbrook | 2861b6a | 2012-02-15 15:25:34 -0800 | [diff] [blame] | 409 | * shown. |
Paul Westbrook | e550355 | 2012-03-28 00:35:57 -0700 | [diff] [blame] | 410 | * Optionally, extra values from {@link EditSettingsExtras} can be used to indicate |
| 411 | * which settings the user wants to edit. |
Paul Westbrook | 2861b6a | 2012-02-15 15:25:34 -0800 | [diff] [blame] | 412 | * TODO: When we want to support a heterogeneous set of account types, this value may need |
| 413 | * to be moved to a global content provider. |
| 414 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 415 | public static final String SETTINGS_INTENT_URI = "accountSettingsIntentUri"; |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 416 | |
| 417 | /** |
Paul Westbrook | 94e440d | 2012-02-24 11:03:47 -0800 | [diff] [blame] | 418 | * Uri for VIEW intent that will cause the help screens for this account type to be |
| 419 | * shown. |
| 420 | * TODO: When we want to support a heterogeneous set of account types, this value may need |
| 421 | * to be moved to a global content provider. |
| 422 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 423 | public static final String HELP_INTENT_URI = "helpIntentUri"; |
Paul Westbrook | 94e440d | 2012-02-24 11:03:47 -0800 | [diff] [blame] | 424 | |
| 425 | /** |
Paul Westbrook | 517743e | 2012-03-22 10:40:46 -0700 | [diff] [blame] | 426 | * Uri for VIEW intent that will cause the send feedback for this account type to be |
| 427 | * shown. |
| 428 | * TODO: When we want to support a heterogeneous set of account types, this value may need |
| 429 | * to be moved to a global content provider. |
| 430 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 431 | public static final String SEND_FEEDBACK_INTENT_URI = "sendFeedbackIntentUri"; |
Paul Westbrook | 517743e | 2012-03-22 10:40:46 -0700 | [diff] [blame] | 432 | |
| 433 | /** |
Paul Westbrook | 122f7c2 | 2012-08-20 17:50:31 -0700 | [diff] [blame] | 434 | * Uri for VIEW intent that will cause the user to be prompted for authentication for |
| 435 | * this account. startActivityForResult() will be called with this intent. Activities that |
Vikram Aggarwal | 41b9e8f | 2012-09-25 10:15:04 -0700 | [diff] [blame] | 436 | * handle this intent are expected to return {@link android.app.Activity#RESULT_OK} if the |
Paul Westbrook | 122f7c2 | 2012-08-20 17:50:31 -0700 | [diff] [blame] | 437 | * user successfully authenticated. |
| 438 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 439 | public static final String REAUTHENTICATION_INTENT_URI = "reauthenticationUri"; |
Paul Westbrook | 122f7c2 | 2012-08-20 17:50:31 -0700 | [diff] [blame] | 440 | |
| 441 | /** |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 442 | * This int column contains the current sync status of the account (the logical AND of the |
| 443 | * sync status of folders in this account) |
| 444 | */ |
| 445 | public static final String SYNC_STATUS = "syncStatus"; |
Mindy Pereira | 23755e2 | 2012-02-27 13:58:04 -0800 | [diff] [blame] | 446 | /** |
| 447 | * Uri for VIEW intent that will cause the compose screens for this type |
| 448 | * of account to be shown. |
| 449 | */ |
| 450 | public static final String COMPOSE_URI = "composeUri"; |
Mindy Pereira | 898cd38 | 2012-03-06 08:42:47 -0800 | [diff] [blame] | 451 | /** |
| 452 | * Mime-type defining this account. |
| 453 | */ |
| 454 | public static final String MIME_TYPE = "mimeType"; |
Vikram Aggarwal | 27e85f2 | 2012-03-05 16:29:17 -0800 | [diff] [blame] | 455 | /** |
| 456 | * URI for location of recent folders viewed on this account. |
| 457 | */ |
| 458 | public static final String RECENT_FOLDER_LIST_URI = "recentFolderListUri"; |
Marc Blank | b287833 | 2012-05-17 15:16:59 -0700 | [diff] [blame] | 459 | /** |
Vikram Aggarwal | 27d89ad | 2012-06-12 13:38:40 -0700 | [diff] [blame] | 460 | * URI for default recent folders for this account, if any. |
| 461 | */ |
| 462 | public static final String DEFAULT_RECENT_FOLDER_LIST_URI = "defaultRecentFolderListUri"; |
| 463 | /** |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 464 | * Color (integer) used for this account (for Email/Combined view) |
Marc Blank | b287833 | 2012-05-17 15:16:59 -0700 | [diff] [blame] | 465 | */ |
| 466 | public static final String COLOR = "color"; |
Mindy Pereira | b378d64 | 2012-07-11 09:46:20 -0700 | [diff] [blame] | 467 | /** |
| 468 | * URI for forcing a manual sync of this account. |
| 469 | */ |
| 470 | public static final String MANUAL_SYNC_URI = "manualSyncUri"; |
Mark Wei | 9982fdb | 2012-08-30 18:27:46 -0700 | [diff] [blame] | 471 | /** |
| 472 | * Optional URI of this account for proxying view intents. |
| 473 | */ |
| 474 | public static final String VIEW_INTENT_PROXY_URI = "viewProxyUri"; |
Paul Westbrook | b8361c9 | 2012-09-27 10:57:14 -0700 | [diff] [blame] | 475 | /** |
| 476 | * Optional URI for querying for the cookie needed for accessing inline content. The cookie |
| 477 | * specified here will be set on the uri specified in the |
| 478 | * {@link ConversationColumns#CONVERSATION_BASE_URI} column. The cursor returned from this |
| 479 | * query is expected have one row, where the columns are specified in |
| 480 | * {@link AccountCookieColumns} |
| 481 | */ |
| 482 | public static final String ACCOUNT_COOKIE_QUERY_URI = "accountCookieUri"; |
Scott Kennedy | 0d0f8b0 | 2012-10-12 15:18:18 -0700 | [diff] [blame] | 483 | /** |
| 484 | * URI to be used with an update() ContentResolver call with a {@link ContentValues} object |
| 485 | * where the keys are from the {@link AccountColumns.SettingsColumns}, and the values are |
| 486 | * the new values. |
| 487 | */ |
| 488 | public static final String UPDATE_SETTINGS_URI = "updateSettingsUri"; |
Alice Yang | 3617b41 | 2013-05-10 00:30:07 -0700 | [diff] [blame] | 489 | /** |
| 490 | * Whether message transforms (HTML DOM manipulation) should be enabled. |
| 491 | */ |
| 492 | public static final String ENABLE_MESSAGE_TRANSFORMS = "enableMessageTransforms"; |
Alice Yang | c86b1fb | 2013-08-11 22:27:25 -0700 | [diff] [blame] | 493 | /** |
| 494 | * Sync authority to use. |
| 495 | */ |
| 496 | public static final String SYNC_AUTHORITY = "syncAuthority"; |
Tony Mantler | 59e6909 | 2013-08-14 11:05:00 -0700 | [diff] [blame] | 497 | /** |
| 498 | * URI for querying this account's quick responses |
| 499 | */ |
| 500 | public static final String QUICK_RESPONSE_URI = "quickResponseUri"; |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 501 | |
| 502 | public static final class SettingsColumns { |
| 503 | /** |
| 504 | * String column containing the contents of the signature for this account. If no |
| 505 | * signature has been specified, the value will be null. |
| 506 | */ |
| 507 | public static final String SIGNATURE = "signature"; |
| 508 | |
| 509 | /** |
| 510 | * Integer column containing the user's specified auto-advance policy. This value will |
| 511 | * be one of the values in {@link UIProvider.AutoAdvance} |
| 512 | */ |
| 513 | public static final String AUTO_ADVANCE = "auto_advance"; |
| 514 | |
| 515 | /** |
| 516 | * Integer column containing the user's specified message text size preference. This |
| 517 | * value will be one of the values in {@link UIProvider.MessageTextSize} |
| 518 | */ |
| 519 | public static final String MESSAGE_TEXT_SIZE = "message_text_size"; |
| 520 | |
| 521 | /** |
| 522 | * Integer column contaning the user's specified snap header preference. This value |
| 523 | * will be one of the values in {@link UIProvider.SnapHeaderValue} |
| 524 | */ |
| 525 | public static final String SNAP_HEADERS = "snap_headers"; |
| 526 | |
| 527 | /** |
| 528 | * Integer column containing the user's specified default reply behavior. This value |
| 529 | * will be one of the values in {@link UIProvider.DefaultReplyBehavior} |
| 530 | */ |
| 531 | public static final String REPLY_BEHAVIOR = "reply_behavior"; |
| 532 | |
| 533 | /** |
Alice Yang | 4a53f5b | 2013-05-02 16:10:48 -0700 | [diff] [blame] | 534 | * Integer column containing the user's preference for whether to show sender images |
| 535 | * or not in the conversation list view. This value will be one of the values in |
| 536 | * {@link UIProvider.ConversationListIcon}. |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 537 | */ |
Alice Yang | 6427314 | 2013-04-10 18:26:56 -0700 | [diff] [blame] | 538 | public static final String CONV_LIST_ICON = "conversation_list_icon"; |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 539 | |
| 540 | /** |
Mark Wei | aa76bdf | 2013-08-06 18:20:11 -0700 | [diff] [blame] | 541 | * Integer column containing the user's preference for whether to show attachment |
| 542 | * previews or not in the conversation list view. A non zero value indicates that |
| 543 | * attachment previews should be displayed. |
| 544 | */ |
| 545 | public static final String CONV_LIST_ATTACHMENT_PREVIEWS |
| 546 | = "conversation_list_attachment_previews"; |
| 547 | |
| 548 | /** |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 549 | * Integer column containing the user's specified confirm delete preference value. |
| 550 | * A non zero value indicates that the user has indicated that a confirmation should |
| 551 | * be shown when a delete action is performed. |
| 552 | */ |
| 553 | public static final String CONFIRM_DELETE = "confirm_delete"; |
| 554 | |
| 555 | /** |
| 556 | * Integer column containing the user's specified confirm archive preference value. |
| 557 | * A non zero value indicates that the user has indicated that a confirmation should |
| 558 | * be shown when an archive action is performed. |
| 559 | */ |
| 560 | public static final String CONFIRM_ARCHIVE = "confirm_archive"; |
| 561 | |
| 562 | /** |
| 563 | * Integer column containing the user's specified confirm send preference value. |
| 564 | * A non zero value indicates that the user has indicated that a confirmation should |
| 565 | * be shown when a send action is performed. |
| 566 | */ |
| 567 | public static final String CONFIRM_SEND = "confirm_send"; |
| 568 | /** |
Mindy Pereira | 571de22 | 2012-07-20 09:28:44 -0700 | [diff] [blame] | 569 | * String containing the URI for the default inbox for this account. |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 570 | */ |
| 571 | public static final String DEFAULT_INBOX = "default_inbox"; |
| 572 | /** |
Vikram Aggarwal | 5e63e8a | 2012-07-19 10:05:24 -0700 | [diff] [blame] | 573 | * String containing the name of the default Inbox for this account |
| 574 | */ |
| 575 | public static final String DEFAULT_INBOX_NAME = "default_inbox_name"; |
| 576 | /** |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 577 | * Integer column containing a non zero value if replies should always be sent from |
| 578 | * a default address instead of a recipient. |
| 579 | */ |
Mindy Pereira | 3cd4f40 | 2012-07-17 11:16:18 -0700 | [diff] [blame] | 580 | public static final String FORCE_REPLY_FROM_DEFAULT = "force_reply_from_default"; |
| 581 | /** |
| 582 | * Integer column containing the max attachment size in kb. |
| 583 | */ |
| 584 | public static final String MAX_ATTACHMENT_SIZE = "max_attachment_size"; |
Mindy Pereira | 71a8f5e | 2012-07-25 14:33:18 -0700 | [diff] [blame] | 585 | /** |
| 586 | * Integer column containing a value matching one of the constants from {@link Swipe} |
| 587 | */ |
| 588 | public static final String SWIPE = "swipe"; |
Vikram Aggarwal | 707f24c | 2012-07-31 15:59:36 -0700 | [diff] [blame] | 589 | /** |
Andy Huang | bab9221 | 2012-11-16 18:32:18 -0800 | [diff] [blame] | 590 | * Integer column containing whether priority inbox arrows are enabled. |
Vikram Aggarwal | 707f24c | 2012-07-31 15:59:36 -0700 | [diff] [blame] | 591 | */ |
| 592 | public static final String PRIORITY_ARROWS_ENABLED = "priority_inbox_arrows_enabled"; |
Marc Blank | 5789908 | 2012-09-05 11:35:57 -0700 | [diff] [blame] | 593 | /** |
| 594 | * Uri for EDIT intent that will cause account-specific setup UI to be shown. If not |
| 595 | * null, this intent should be used when an account is "entered" (i.e. viewing a folder |
| 596 | * in the account, etc.) |
| 597 | */ |
| 598 | public static final String SETUP_INTENT_URI = "setup_intent_uri"; |
Paul Westbrook | fa255c0 | 2012-10-13 14:32:52 -0700 | [diff] [blame] | 599 | /** |
Vikram Aggarwal | 69a6cdf | 2013-01-08 16:05:17 -0800 | [diff] [blame] | 600 | * The regex that defines a veiled address, something that must be hidden from user |
| 601 | * view because it is temporary, long and clumsy. |
| 602 | */ |
Vikram Aggarwal | 6c3875a | 2013-01-15 16:00:11 -0800 | [diff] [blame] | 603 | public static final String VEILED_ADDRESS_PATTERN = "veiled_address_pattern"; |
Vikram Aggarwal | 69a6cdf | 2013-01-08 16:05:17 -0800 | [diff] [blame] | 604 | /** |
Paul Westbrook | fa255c0 | 2012-10-13 14:32:52 -0700 | [diff] [blame] | 605 | * Integer column containing the Conversation view mode. This value will match one of |
| 606 | * constants from {@link ConversationViewMode} |
| 607 | */ |
| 608 | public static final String CONVERSATION_VIEW_MODE = "conversation_view_mode"; |
Scott Kennedy | dd2ec68 | 2013-06-03 19:16:13 -0700 | [diff] [blame] | 609 | /** |
| 610 | * String containing the URI for the inbox conversations should be moved to for this |
| 611 | * account. |
| 612 | */ |
| 613 | public static final String MOVE_TO_INBOX = "move_to_inbox"; |
Alice Yang | f323c04 | 2013-10-30 00:15:02 -0700 | [diff] [blame] | 614 | /** |
| 615 | * Show images in conversation view. |
| 616 | */ |
| 617 | public static final String SHOW_IMAGES = "show_images"; |
Paul Westbrook | b1f573c | 2012-04-06 11:38:28 -0700 | [diff] [blame] | 618 | } |
Mindy Pereira | 3a565bf | 2011-12-21 11:26:21 -0800 | [diff] [blame] | 619 | } |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 620 | |
Tony Mantler | 59e6909 | 2013-08-14 11:05:00 -0700 | [diff] [blame] | 621 | public static final String[] QUICK_RESPONSE_PROJECTION = { |
| 622 | BaseColumns._ID, |
| 623 | QuickResponseColumns.TEXT, |
| 624 | QuickResponseColumns.URI |
| 625 | }; |
| 626 | |
| 627 | public static final class QuickResponseColumns { |
| 628 | /** |
| 629 | * Text of the Quick Response |
| 630 | */ |
| 631 | public static final String TEXT = "quickResponse"; |
| 632 | /** |
| 633 | * URI to access this row directly |
| 634 | */ |
| 635 | public static final String URI = "uri"; |
| 636 | } |
| 637 | |
Paul Westbrook | b8361c9 | 2012-09-27 10:57:14 -0700 | [diff] [blame] | 638 | public static final String[] ACCOUNT_COOKIE_PROJECTION = { |
| 639 | AccountCookieColumns.COOKIE |
| 640 | }; |
| 641 | |
| 642 | public static final class AccountCookieColumns { |
| 643 | /** |
| 644 | * String column containing the cookie string for this account. |
| 645 | */ |
| 646 | public static final String COOKIE = "cookie"; |
| 647 | } |
| 648 | |
Paul Westbrook | 8130e6f | 2012-03-06 13:51:01 -0800 | [diff] [blame] | 649 | public static final class SearchQueryParameters { |
| 650 | /** |
| 651 | * Parameter used to specify the search query. |
| 652 | */ |
| 653 | public static final String QUERY = "query"; |
| 654 | |
Paul Westbrook | 8130e6f | 2012-03-06 13:51:01 -0800 | [diff] [blame] | 655 | private SearchQueryParameters() {} |
| 656 | } |
| 657 | |
Marc Blank | 5114494 | 2012-03-20 13:59:32 -0700 | [diff] [blame] | 658 | public static final class ConversationListQueryParameters { |
| 659 | public static final String DEFAULT_LIMIT = "50"; |
| 660 | /** |
| 661 | * Parameter used to limit the number of rows returned by a conversation list query |
| 662 | */ |
| 663 | public static final String LIMIT = "limit"; |
| 664 | |
Paul Westbrook | 5f2876a | 2012-03-20 18:47:22 -0700 | [diff] [blame] | 665 | /** |
| 666 | * Parameter used to control whether the this query a remote server. |
| 667 | */ |
| 668 | public static final String USE_NETWORK = "use_network"; |
| 669 | |
Paul Westbrook | 4880b5d | 2012-07-24 09:10:25 -0700 | [diff] [blame] | 670 | /** |
| 671 | * Parameter used to allow the caller to indicate desire to receive all notifications. |
| 672 | * (Including ones for user initiated actions) |
| 673 | */ |
| 674 | public static final String ALL_NOTIFICATIONS = "all_notifications"; |
| 675 | |
Marc Blank | 5114494 | 2012-03-20 13:59:32 -0700 | [diff] [blame] | 676 | private ConversationListQueryParameters() {} |
| 677 | } |
| 678 | |
Mindy Pereira | 3a565bf | 2011-12-21 11:26:21 -0800 | [diff] [blame] | 679 | // We define a "folder" as anything that contains a list of conversations. |
| 680 | public static final String FOLDER_LIST_TYPE = |
| 681 | "vnd.android.cursor.dir/vnd.com.android.mail.folder"; |
| 682 | public static final String FOLDER_TYPE = |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 683 | "vnd.android.cursor.item/vnd.com.android.mail.folder"; |
Mindy Pereira | 3a565bf | 2011-12-21 11:26:21 -0800 | [diff] [blame] | 684 | |
| 685 | public static final String[] FOLDERS_PROJECTION = { |
Tony Mantler | 70147a9 | 2013-10-14 16:34:45 -0700 | [diff] [blame] | 686 | FolderColumns._ID, |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 687 | FolderColumns.PERSISTENT_ID, |
Mindy Pereira | 6349a04 | 2012-01-04 11:25:01 -0800 | [diff] [blame] | 688 | FolderColumns.URI, |
Mindy Pereira | 3a565bf | 2011-12-21 11:26:21 -0800 | [diff] [blame] | 689 | FolderColumns.NAME, |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 690 | FolderColumns.HAS_CHILDREN, |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 691 | FolderColumns.CAPABILITIES, |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 692 | FolderColumns.SYNC_WINDOW, |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 693 | FolderColumns.CONVERSATION_LIST_URI, |
Mindy Pereira | bd8f51c | 2012-01-06 13:41:48 -0800 | [diff] [blame] | 694 | FolderColumns.CHILD_FOLDERS_LIST_URI, |
Scott Kennedy | 61bd0e8 | 2012-12-10 18:18:17 -0800 | [diff] [blame] | 695 | FolderColumns.UNSEEN_COUNT, |
Mindy Pereira | bd8f51c | 2012-01-06 13:41:48 -0800 | [diff] [blame] | 696 | FolderColumns.UNREAD_COUNT, |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 697 | FolderColumns.TOTAL_COUNT, |
Mindy Pereira | 7752864 | 2012-02-17 15:51:10 -0800 | [diff] [blame] | 698 | FolderColumns.REFRESH_URI, |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 699 | FolderColumns.SYNC_STATUS, |
Mindy Pereira | 7866472 | 2012-03-05 13:53:07 -0800 | [diff] [blame] | 700 | FolderColumns.LAST_SYNC_RESULT, |
| 701 | FolderColumns.TYPE, |
Mindy Pereira | 9275a06 | 2012-03-08 15:12:14 -0800 | [diff] [blame] | 702 | FolderColumns.ICON_RES_ID, |
Scott Kennedy | 61bd0e8 | 2012-12-10 18:18:17 -0800 | [diff] [blame] | 703 | FolderColumns.NOTIFICATION_ICON_RES_ID, |
Mindy Pereira | 9275a06 | 2012-03-08 15:12:14 -0800 | [diff] [blame] | 704 | FolderColumns.BG_COLOR, |
Marc Blank | 48a4aed | 2012-03-10 14:07:00 -0800 | [diff] [blame] | 705 | FolderColumns.FG_COLOR, |
Mindy Pereira | c1e8790 | 2012-06-26 11:51:41 -0700 | [diff] [blame] | 706 | FolderColumns.LOAD_MORE_URI, |
Scott Kennedy | 7c8325d | 2013-02-28 10:46:10 -0800 | [diff] [blame] | 707 | FolderColumns.HIERARCHICAL_DESC, |
Vikram Aggarwal | a3bbac0 | 2013-07-03 15:53:44 -0700 | [diff] [blame] | 708 | FolderColumns.LAST_MESSAGE_TIMESTAMP, |
| 709 | FolderColumns.PARENT_URI |
Mindy Pereira | 3a565bf | 2011-12-21 11:26:21 -0800 | [diff] [blame] | 710 | }; |
| 711 | |
Tony Mantler | 42fe486 | 2013-10-23 11:39:19 -0700 | [diff] [blame] | 712 | public static final String[] FOLDERS_PROJECTION_WITH_UNREAD_SENDERS = |
| 713 | (new ImmutableList.Builder<String>() |
| 714 | .addAll(ImmutableList.copyOf(FOLDERS_PROJECTION)) |
| 715 | .add(FolderColumns.UNREAD_SENDERS) |
| 716 | .build().toArray(new String[0])); |
| 717 | |
Mindy Pereira | 7e5de7a | 2012-03-13 15:36:03 -0700 | [diff] [blame] | 718 | public static final int FOLDER_ID_COLUMN = 0; |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 719 | public static final int FOLDER_PERSISTENT_ID_COLUMN = 1; |
| 720 | public static final int FOLDER_URI_COLUMN = 2; |
| 721 | public static final int FOLDER_NAME_COLUMN = 3; |
| 722 | public static final int FOLDER_HAS_CHILDREN_COLUMN = 4; |
| 723 | public static final int FOLDER_CAPABILITIES_COLUMN = 5; |
| 724 | public static final int FOLDER_SYNC_WINDOW_COLUMN = 6; |
| 725 | public static final int FOLDER_CONVERSATION_LIST_URI_COLUMN = 7; |
| 726 | public static final int FOLDER_CHILD_FOLDERS_LIST_COLUMN = 8; |
Scott Kennedy | 61bd0e8 | 2012-12-10 18:18:17 -0800 | [diff] [blame] | 727 | public static final int FOLDER_UNSEEN_COUNT_COLUMN = 9; |
| 728 | public static final int FOLDER_UNREAD_COUNT_COLUMN = 10; |
| 729 | public static final int FOLDER_TOTAL_COUNT_COLUMN = 11; |
| 730 | public static final int FOLDER_REFRESH_URI_COLUMN = 12; |
| 731 | public static final int FOLDER_SYNC_STATUS_COLUMN = 13; |
| 732 | public static final int FOLDER_LAST_SYNC_RESULT_COLUMN = 14; |
| 733 | public static final int FOLDER_TYPE_COLUMN = 15; |
| 734 | public static final int FOLDER_ICON_RES_ID_COLUMN = 16; |
| 735 | public static final int FOLDER_NOTIFICATION_ICON_RES_ID_COLUMN = 17; |
| 736 | public static final int FOLDER_BG_COLOR_COLUMN = 18; |
| 737 | public static final int FOLDER_FG_COLOR_COLUMN = 19; |
| 738 | public static final int FOLDER_LOAD_MORE_URI_COLUMN = 20; |
| 739 | public static final int FOLDER_HIERARCHICAL_DESC_COLUMN = 21; |
Scott Kennedy | 7c8325d | 2013-02-28 10:46:10 -0800 | [diff] [blame] | 740 | public static final int FOLDER_LAST_MESSAGE_TIMESTAMP_COLUMN = 22; |
Vikram Aggarwal | a3bbac0 | 2013-07-03 15:53:44 -0700 | [diff] [blame] | 741 | public static final int FOLDER_PARENT_URI_COLUMN = 23; |
Mindy Pereira | 7866472 | 2012-03-05 13:53:07 -0800 | [diff] [blame] | 742 | |
| 743 | public static final class FolderType { |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 744 | /** A user defined label. */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 745 | public static final int DEFAULT = 1 << 0; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 746 | /** A system defined inbox */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 747 | public static final int INBOX = 1 << 1; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 748 | /** A system defined containing mails to be edited before sending. */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 749 | public static final int DRAFT = 1 << 2; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 750 | /** A system defined folder containing mails <b>to be</b> sent */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 751 | public static final int OUTBOX = 1 << 3; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 752 | /** A system defined folder containing sent mails */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 753 | public static final int SENT = 1 << 4; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 754 | /** A system defined trash folder */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 755 | public static final int TRASH = 1 << 5; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 756 | /** A system defined spam folder */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 757 | public static final int SPAM = 1 << 6; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 758 | /** A system defined starred folder */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 759 | public static final int STARRED = 1 << 7; |
Vikram Aggarwal | 58cad2e | 2012-08-28 16:18:23 -0700 | [diff] [blame] | 760 | /** Any other system label that we do not have a specific name for. */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 761 | public static final int OTHER_PROVIDER_FOLDER = 1 << 8; |
Scott Kennedy | dd2ec68 | 2013-06-03 19:16:13 -0700 | [diff] [blame] | 762 | /** All mail folder */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 763 | public static final int ALL_MAIL = 1 << 9; |
Scott Kennedy | dd2ec68 | 2013-06-03 19:16:13 -0700 | [diff] [blame] | 764 | /** Gmail's inbox sections */ |
Scott Kennedy | 8c1058e | 2013-03-20 13:40:20 -0700 | [diff] [blame] | 765 | public static final int INBOX_SECTION = 1 << 10; |
Andrew Sapperstein | e58a66c | 2013-06-26 16:27:02 -0700 | [diff] [blame] | 766 | /** A system defined unread folder */ |
| 767 | public static final int UNREAD = 1 << 11; |
Scott Kennedy | a158ac8 | 2013-09-04 13:48:13 -0700 | [diff] [blame] | 768 | /** A "fake" search folder */ |
| 769 | public static final int SEARCH = 1 << 12; |
Mindy Pereira | 7866472 | 2012-03-05 13:53:07 -0800 | [diff] [blame] | 770 | } |
Mindy Pereira | 818143e | 2012-01-11 13:59:49 -0800 | [diff] [blame] | 771 | |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 772 | public static final class FolderCapabilities { |
| 773 | public static final int SYNCABLE = 0x0001; |
| 774 | public static final int PARENT = 0x0002; |
Andrew Sapperstein | f33d7d4 | 2013-09-03 15:11:25 -0700 | [diff] [blame] | 775 | // FEEL FREE TO USE 0x0004 - was previous CAN_HOLD_MAIL but that was true for all |
| 776 | // folders so we removed that value |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 777 | public static final int CAN_ACCEPT_MOVED_MESSAGES = 0x0008; |
Marc Blank | a835205 | 2012-04-04 11:37:48 -0700 | [diff] [blame] | 778 | /** |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 779 | * For accounts that support archive, this will indicate that this folder supports |
| 780 | * the archive functionality. |
| 781 | */ |
| 782 | public static final int ARCHIVE = 0x0010; |
| 783 | |
| 784 | /** |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 785 | * This will indicated that this folder supports the delete functionality. |
| 786 | */ |
| 787 | public static final int DELETE = 0x0020; |
| 788 | |
| 789 | /** |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 790 | * For accounts that support report spam, this will indicate that this folder supports |
| 791 | * the report spam functionality. |
| 792 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 793 | public static final int REPORT_SPAM = 0x0040; |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 794 | |
| 795 | /** |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 796 | * For accounts that support report spam, this will indicate that this folder supports |
Paul Westbrook | 76b2062 | 2012-07-12 11:45:43 -0700 | [diff] [blame] | 797 | * the mark not spam functionality. |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 798 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 799 | public static final int MARK_NOT_SPAM = 0x0080; |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 800 | |
| 801 | /** |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 802 | * For accounts that support mute, this will indicate if a mute is performed from within |
| 803 | * this folder, the action is destructive. |
| 804 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 805 | public static final int DESTRUCTIVE_MUTE = 0x0100; |
Marc Blank | a835205 | 2012-04-04 11:37:48 -0700 | [diff] [blame] | 806 | |
| 807 | /** |
| 808 | * Indicates that a folder supports settings (sync lookback, etc.) |
| 809 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 810 | public static final int SUPPORTS_SETTINGS = 0x0200; |
Vikram Aggarwal | 04dc819 | 2012-04-09 13:07:19 -0700 | [diff] [blame] | 811 | /** |
| 812 | * All the messages in this folder are important. |
| 813 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 814 | public static final int ONLY_IMPORTANT = 0x0400; |
Marc Blank | 386243f | 2012-05-25 10:40:59 -0700 | [diff] [blame] | 815 | /** |
| 816 | * Deletions in this folder can't be undone (could include archive if desirable) |
| 817 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 818 | public static final int DELETE_ACTION_FINAL = 0x0800; |
Marc Blank | a6b671d | 2012-05-25 12:52:02 -0700 | [diff] [blame] | 819 | /** |
| 820 | * This folder is virtual, i.e. contains conversations potentially pulled from other |
| 821 | * folders, potentially even from different accounts. Examples might be a "starred" |
| 822 | * folder, or an "unread" folder (per account or provider-wide) |
| 823 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 824 | public static final int IS_VIRTUAL = 0x1000; |
Paul Westbrook | 76b2062 | 2012-07-12 11:45:43 -0700 | [diff] [blame] | 825 | |
| 826 | /** |
| 827 | * For accounts that support report phishing, this will indicate that this folder supports |
| 828 | * the report phishing functionality. |
| 829 | */ |
Paul Westbrook | 6102c7d | 2012-08-19 13:20:24 -0700 | [diff] [blame] | 830 | public static final int REPORT_PHISHING = 0x2000; |
Rohan Shah | 6f95dd2 | 2013-02-08 10:13:52 -0800 | [diff] [blame] | 831 | |
| 832 | /** |
| 833 | * The flag indicates that the user has the ability to move conversations |
| 834 | * from this folder. |
| 835 | */ |
| 836 | public static final int ALLOWS_REMOVE_CONVERSATION = 0x4000; |
Scott Kennedy | e7e0163 | 2013-04-25 17:08:53 -0700 | [diff] [blame] | 837 | |
| 838 | /** |
| 839 | * The flag indicates that the user has the ability to move conversations to or from this |
| 840 | * Folder in the same operation as other Folder changes (usually through |
Scott Kennedy | d372804 | 2013-04-25 20:23:10 -0700 | [diff] [blame] | 841 | * {@link com.android.mail.ui.MultiFoldersSelectionDialog}). |
Scott Kennedy | e7e0163 | 2013-04-25 17:08:53 -0700 | [diff] [blame] | 842 | */ |
| 843 | public static final int MULTI_MOVE = 0x8000; |
Scott Kennedy | dd2ec68 | 2013-06-03 19:16:13 -0700 | [diff] [blame] | 844 | |
| 845 | /** |
| 846 | * This flag indicates that a conversation may be moved from this folder into the account's |
| 847 | * inbox. |
| 848 | */ |
| 849 | public static final int ALLOWS_MOVE_TO_INBOX = 0x10000; |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 850 | } |
| 851 | |
Tony Mantler | 70147a9 | 2013-10-14 16:34:45 -0700 | [diff] [blame] | 852 | public static final class FolderColumns implements BaseColumns { |
Paul Westbrook | 0b63e8d | 2012-03-13 11:52:42 -0700 | [diff] [blame] | 853 | /** |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 854 | * This string column contains an id for the folder that is constant across devices, or |
| 855 | * null if there is no constant id. |
| 856 | */ |
| 857 | public static final String PERSISTENT_ID = "persistentId"; |
| 858 | /** |
Paul Westbrook | 0b63e8d | 2012-03-13 11:52:42 -0700 | [diff] [blame] | 859 | * This string column contains the uri of the folder. |
| 860 | */ |
Mindy Pereira | 7752864 | 2012-02-17 15:51:10 -0800 | [diff] [blame] | 861 | public static final String URI = "folderUri"; |
Mindy Pereira | 3a565bf | 2011-12-21 11:26:21 -0800 | [diff] [blame] | 862 | /** |
| 863 | * This string column contains the human visible name for the folder. |
| 864 | */ |
| 865 | public static final String NAME = "name"; |
| 866 | /** |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 867 | * This int column represents the capabilities of the folder specified by |
| 868 | * FolderCapabilities flags. |
| 869 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 870 | public static final String CAPABILITIES = "capabilities"; |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 871 | /** |
Mindy Pereira | fc2277e | 2012-01-11 10:23:44 -0800 | [diff] [blame] | 872 | * This int column represents whether or not this folder has any |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 873 | * child folders. |
| 874 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 875 | public static final String HAS_CHILDREN = "hasChildren"; |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 876 | /** |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 877 | * This int column represents how large the sync window is. |
| 878 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 879 | public static final String SYNC_WINDOW = "syncWindow"; |
Mindy Pereira | 0973b20 | 2011-12-21 15:48:12 -0800 | [diff] [blame] | 880 | /** |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 881 | * This string column contains the content provider uri to return the |
| 882 | * list of conversations for this folder. |
Mindy Pereira | 3a565bf | 2011-12-21 11:26:21 -0800 | [diff] [blame] | 883 | */ |
| 884 | public static final String CONVERSATION_LIST_URI = "conversationListUri"; |
Mindy Pereira | 750cc73 | 2011-12-21 13:32:29 -0800 | [diff] [blame] | 885 | /** |
| 886 | * This string column contains the content provider uri to return the |
| 887 | * list of child folders of this folder. |
| 888 | */ |
Mindy Pereira | 7752864 | 2012-02-17 15:51:10 -0800 | [diff] [blame] | 889 | public static final String CHILD_FOLDERS_LIST_URI = "childFoldersListUri"; |
Scott Kennedy | 61bd0e8 | 2012-12-10 18:18:17 -0800 | [diff] [blame] | 890 | /** |
| 891 | * This int column contains the current unseen count for the folder, if known. |
| 892 | */ |
| 893 | public static final String UNSEEN_COUNT = "unseenCount"; |
| 894 | /** |
| 895 | * This int column contains the current unread count for the folder. |
| 896 | */ |
Mindy Pereira | 7752864 | 2012-02-17 15:51:10 -0800 | [diff] [blame] | 897 | public static final String UNREAD_COUNT = "unreadCount"; |
Mindy Pereira | bd8f51c | 2012-01-06 13:41:48 -0800 | [diff] [blame] | 898 | |
Mindy Pereira | 7752864 | 2012-02-17 15:51:10 -0800 | [diff] [blame] | 899 | public static final String TOTAL_COUNT = "totalCount"; |
Mindy Pereira | 9c00210 | 2012-02-17 14:45:58 -0800 | [diff] [blame] | 900 | /** |
| 901 | * This string column contains the content provider uri to force a |
| 902 | * refresh of this folder. |
| 903 | */ |
Mindy Pereira | 7752864 | 2012-02-17 15:51:10 -0800 | [diff] [blame] | 904 | public static final String REFRESH_URI = "refreshUri"; |
| 905 | /** |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 906 | * This int column contains current sync status of the folder; some combination of the |
| 907 | * SyncStatus bits defined above |
Mindy Pereira | 7752864 | 2012-02-17 15:51:10 -0800 | [diff] [blame] | 908 | */ |
Marc Blank | 9ace18a | 2012-02-21 16:34:07 -0800 | [diff] [blame] | 909 | public static final String SYNC_STATUS = "syncStatus"; |
| 910 | /** |
| 911 | * This int column contains the sync status of the last sync attempt; one of the |
| 912 | * LastSyncStatus values defined above |
| 913 | */ |
| 914 | public static final String LAST_SYNC_RESULT = "lastSyncResult"; |
Mindy Pereira | 7866472 | 2012-03-05 13:53:07 -0800 | [diff] [blame] | 915 | /** |
Scott Kennedy | 61bd0e8 | 2012-12-10 18:18:17 -0800 | [diff] [blame] | 916 | * This int column contains the icon res id for this folder, or 0 if there is none. |
Mindy Pereira | 7866472 | 2012-03-05 13:53:07 -0800 | [diff] [blame] | 917 | */ |
| 918 | public static final String ICON_RES_ID = "iconResId"; |
| 919 | /** |
Scott Kennedy | 61bd0e8 | 2012-12-10 18:18:17 -0800 | [diff] [blame] | 920 | * This int column contains the notification icon res id for this folder, or 0 if there is |
| 921 | * none. |
| 922 | */ |
| 923 | public static final String NOTIFICATION_ICON_RES_ID = "notificationIconResId"; |
| 924 | /** |
Mindy Pereira | 7866472 | 2012-03-05 13:53:07 -0800 | [diff] [blame] | 925 | * This int column contains the type of the folder. Zero is default. |
| 926 | */ |
| 927 | public static final String TYPE = "type"; |
Mindy Pereira | 9275a06 | 2012-03-08 15:12:14 -0800 | [diff] [blame] | 928 | /** |
| 929 | * String representing the integer background color associated with this |
| 930 | * folder, or null. |
| 931 | */ |
| 932 | public static final String BG_COLOR = "bgColor"; |
| 933 | /** |
| 934 | * String representing the integer of the foreground color associated |
| 935 | * with this folder, or null. |
| 936 | */ |
| 937 | public static final String FG_COLOR = "fgColor"; |
Marc Blank | 48a4aed | 2012-03-10 14:07:00 -0800 | [diff] [blame] | 938 | /** |
| 939 | * String with the content provider Uri used to request more items in the folder, or null. |
| 940 | */ |
| 941 | public static final String LOAD_MORE_URI = "loadMoreUri"; |
Vikram Aggarwal | 27d89ad | 2012-06-12 13:38:40 -0700 | [diff] [blame] | 942 | |
Mindy Pereira | c1e8790 | 2012-06-26 11:51:41 -0700 | [diff] [blame] | 943 | /** |
| 944 | * Possibly empty string that describes the full hierarchy of a folder |
| 945 | * along with its name. |
| 946 | */ |
| 947 | public static final String HIERARCHICAL_DESC = "hierarchicalDesc"; |
| 948 | |
Scott Kennedy | 7c8325d | 2013-02-28 10:46:10 -0800 | [diff] [blame] | 949 | /** |
| 950 | * The timestamp of the last message received in this folder. |
| 951 | */ |
| 952 | public static final String LAST_MESSAGE_TIMESTAMP = "lastMessageTimestamp"; |
| 953 | |
Vikram Aggarwal | a3bbac0 | 2013-07-03 15:53:44 -0700 | [diff] [blame] | 954 | /** |
| 955 | * The URI, possibly null, of the parent folder. |
| 956 | */ |
| 957 | public static final String PARENT_URI = "parentUri"; |
| 958 | |
Tony Mantler | 42fe486 | 2013-10-23 11:39:19 -0700 | [diff] [blame] | 959 | /** |
| 960 | * A string of unread senders sorted by date, so we don't have to fetch this in multiple |
| 961 | * queries |
| 962 | */ |
| 963 | public static final String UNREAD_SENDERS = "unreadSenders"; |
| 964 | |
Vikram Aggarwal | ff7d02a | 2012-01-11 16:37:45 -0800 | [diff] [blame] | 965 | public FolderColumns() {} |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 966 | } |
| 967 | |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 968 | // We define a "folder" as anything that contains a list of conversations. |
| 969 | public static final String CONVERSATION_LIST_TYPE = |
| 970 | "vnd.android.cursor.dir/vnd.com.android.mail.conversation"; |
| 971 | public static final String CONVERSATION_TYPE = |
| 972 | "vnd.android.cursor.item/vnd.com.android.mail.conversation"; |
| 973 | |
Mindy Pereira | 9cdc406 | 2012-02-02 14:18:08 -0800 | [diff] [blame] | 974 | |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 975 | public static final String[] CONVERSATION_PROJECTION = { |
| 976 | BaseColumns._ID, |
Mindy Pereira | 6349a04 | 2012-01-04 11:25:01 -0800 | [diff] [blame] | 977 | ConversationColumns.URI, |
Mindy Pereira | f9573c5 | 2011-12-22 14:02:49 -0800 | [diff] [blame] | 978 | ConversationColumns.MESSAGE_LIST_URI, |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 979 | ConversationColumns.SUBJECT, |
Mindy Pereira | f9573c5 | 2011-12-22 14:02:49 -0800 | [diff] [blame] | 980 | ConversationColumns.SNIPPET, |
Mindy Pereira | 648df3f | 2012-07-19 09:20:26 -0700 | [diff] [blame] | 981 | ConversationColumns.CONVERSATION_INFO, |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 982 | ConversationColumns.DATE_RECEIVED_MS, |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 983 | ConversationColumns.HAS_ATTACHMENTS, |
| 984 | ConversationColumns.NUM_MESSAGES, |
| 985 | ConversationColumns.NUM_DRAFTS, |
| 986 | ConversationColumns.SENDING_STATE, |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 987 | ConversationColumns.PRIORITY, |
| 988 | ConversationColumns.READ, |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 989 | ConversationColumns.SEEN, |
Mindy Pereira | 36b6c8b | 2012-02-03 14:16:07 -0800 | [diff] [blame] | 990 | ConversationColumns.STARRED, |
Mindy Pereira | 2265752 | 2012-03-14 13:27:59 -0700 | [diff] [blame] | 991 | ConversationColumns.RAW_FOLDERS, |
| 992 | ConversationColumns.FLAGS, |
Mindy Pereira | 87d535f | 2012-03-23 11:15:56 -0700 | [diff] [blame] | 993 | ConversationColumns.PERSONAL_LEVEL, |
| 994 | ConversationColumns.SPAM, |
Paul Westbrook | 76b2062 | 2012-07-12 11:45:43 -0700 | [diff] [blame] | 995 | ConversationColumns.PHISHING, |
Marc Blank | 92939fc | 2012-04-30 14:58:40 -0700 | [diff] [blame] | 996 | ConversationColumns.MUTED, |
Marc Blank | a6b671d | 2012-05-25 12:52:02 -0700 | [diff] [blame] | 997 | ConversationColumns.COLOR, |
Mindy Pereira | 648df3f | 2012-07-19 09:20:26 -0700 | [diff] [blame] | 998 | ConversationColumns.ACCOUNT_URI, |
Paul Westbrook | 41dca18 | 2012-08-07 10:43:42 -0700 | [diff] [blame] | 999 | ConversationColumns.SENDER_INFO, |
Andy Huang | f98bc89 | 2012-08-07 18:22:09 -0700 | [diff] [blame] | 1000 | ConversationColumns.CONVERSATION_BASE_URI, |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 1001 | ConversationColumns.REMOTE, |
| 1002 | ConversationColumns.ATTACHMENT_PREVIEW_URI0, |
| 1003 | ConversationColumns.ATTACHMENT_PREVIEW_URI1, |
| 1004 | ConversationColumns.ATTACHMENT_PREVIEW_STATES, |
| 1005 | ConversationColumns.ATTACHMENT_PREVIEWS_COUNT, |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1006 | }; |
| 1007 | |
Paul Westbrook | 5bb0f80 | 2013-06-06 10:01:15 -0700 | [diff] [blame] | 1008 | /** |
| 1009 | * This integer corresponds to the number of rows of queries that specify the |
| 1010 | * {@link UIProvider#CONVERSATION_PROJECTION} projection will fit in a single |
| 1011 | * {@link android.database.CursorWindow} |
| 1012 | */ |
Alice Yang | 25e6772 | 2013-08-28 13:01:53 -0700 | [diff] [blame] | 1013 | public static final int CONVERSATION_PROJECTION_QUERY_CURSOR_WINDOW_LIMT = 1500; |
Paul Westbrook | 5bb0f80 | 2013-06-06 10:01:15 -0700 | [diff] [blame] | 1014 | |
Mindy Pereira | fdd984b | 2011-12-29 09:43:45 -0800 | [diff] [blame] | 1015 | // These column indexes only work when the caller uses the |
| 1016 | // default CONVERSATION_PROJECTION defined above. |
Mindy Pereira | fa7ef6e | 2011-12-29 14:18:15 -0800 | [diff] [blame] | 1017 | public static final int CONVERSATION_ID_COLUMN = 0; |
Mindy Pereira | 3263fa9 | 2012-01-04 10:15:32 -0800 | [diff] [blame] | 1018 | public static final int CONVERSATION_URI_COLUMN = 1; |
| 1019 | public static final int CONVERSATION_MESSAGE_LIST_URI_COLUMN = 2; |
| 1020 | public static final int CONVERSATION_SUBJECT_COLUMN = 3; |
| 1021 | public static final int CONVERSATION_SNIPPET_COLUMN = 4; |
Mindy Pereira | 648df3f | 2012-07-19 09:20:26 -0700 | [diff] [blame] | 1022 | public static final int CONVERSATION_INFO_COLUMN = 5; |
Mindy Pereira | 3263fa9 | 2012-01-04 10:15:32 -0800 | [diff] [blame] | 1023 | public static final int CONVERSATION_DATE_RECEIVED_MS_COLUMN = 6; |
| 1024 | public static final int CONVERSATION_HAS_ATTACHMENTS_COLUMN = 7; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1025 | public static final int CONVERSATION_NUM_MESSAGES_COLUMN = 8; |
| 1026 | public static final int CONVERSATION_NUM_DRAFTS_COLUMN = 9; |
| 1027 | public static final int CONVERSATION_SENDING_STATE_COLUMN = 10; |
| 1028 | public static final int CONVERSATION_PRIORITY_COLUMN = 11; |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1029 | public static final int CONVERSATION_READ_COLUMN = 12; |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 1030 | public static final int CONVERSATION_SEEN_COLUMN = 13; |
| 1031 | public static final int CONVERSATION_STARRED_COLUMN = 14; |
| 1032 | public static final int CONVERSATION_RAW_FOLDERS_COLUMN = 15; |
| 1033 | public static final int CONVERSATION_FLAGS_COLUMN = 16; |
| 1034 | public static final int CONVERSATION_PERSONAL_LEVEL_COLUMN = 17; |
| 1035 | public static final int CONVERSATION_IS_SPAM_COLUMN = 18; |
| 1036 | public static final int CONVERSATION_IS_PHISHING_COLUMN = 19; |
| 1037 | public static final int CONVERSATION_MUTED_COLUMN = 20; |
| 1038 | public static final int CONVERSATION_COLOR_COLUMN = 21; |
| 1039 | public static final int CONVERSATION_ACCOUNT_URI_COLUMN = 22; |
| 1040 | public static final int CONVERSATION_SENDER_INFO_COLUMN = 23; |
| 1041 | public static final int CONVERSATION_BASE_URI_COLUMN = 24; |
| 1042 | public static final int CONVERSATION_REMOTE_COLUMN = 25; |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 1043 | public static final int CONVERSATION_ATTACHMENT_PREVIEW_URI0_COLUMN = 26; |
| 1044 | public static final int CONVERSATION_ATTACHMENT_PREVIEW_URI1_COLUMN = 27; |
| 1045 | public static final int CONVERSATION_ATTACHMENT_PREVIEW_STATES_COLUMN = 28; |
| 1046 | public static final int CONVERSATION_ATTACHMENT_PREVIEWS_COUNT_COLUMN = 29; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1047 | |
| 1048 | public static final class ConversationSendingState { |
Mindy Pereira | a457137 | 2012-01-12 14:04:21 -0800 | [diff] [blame] | 1049 | public static final int OTHER = 0; |
Paul Westbrook | 2c63630 | 2012-08-03 10:12:41 -0700 | [diff] [blame] | 1050 | public static final int QUEUED = 1; |
| 1051 | public static final int SENDING = 2; |
| 1052 | public static final int SENT = 3; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1053 | public static final int SEND_ERROR = -1; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 1054 | } |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1055 | |
| 1056 | public static final class ConversationPriority { |
Mindy Pereira | 2265752 | 2012-03-14 13:27:59 -0700 | [diff] [blame] | 1057 | public static final int DEFAULT = 0; |
| 1058 | public static final int IMPORTANT = 1; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1059 | public static final int LOW = 0; |
| 1060 | public static final int HIGH = 1; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 1061 | } |
Mindy Pereira | fa7ef6e | 2011-12-29 14:18:15 -0800 | [diff] [blame] | 1062 | |
Mindy Pereira | 2265752 | 2012-03-14 13:27:59 -0700 | [diff] [blame] | 1063 | public static final class ConversationPersonalLevel { |
| 1064 | public static final int NOT_TO_ME = 0; |
| 1065 | public static final int TO_ME_AND_OTHERS = 1; |
| 1066 | public static final int ONLY_TO_ME = 2; |
| 1067 | } |
| 1068 | |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1069 | public static final class ConversationFlags { |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1070 | public static final int REPLIED = 1<<2; |
| 1071 | public static final int FORWARDED = 1<<3; |
Mindy Pereira | d69f5ad | 2012-03-14 13:20:24 -0700 | [diff] [blame] | 1072 | public static final int CALENDAR_INVITE = 1<<4; |
Vikram Aggarwal | 859681b | 2012-02-03 10:02:24 -0800 | [diff] [blame] | 1073 | } |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1074 | |
Paul Westbrook | 76b2062 | 2012-07-12 11:45:43 -0700 | [diff] [blame] | 1075 | public static final class ConversationPhishing { |
| 1076 | public static final int NOT_PHISHING = 0; |
| 1077 | public static final int PHISHING = 1; |
| 1078 | } |
| 1079 | |
Vikram Aggarwal | 531488e | 2012-05-29 16:36:52 -0700 | [diff] [blame] | 1080 | /** |
| 1081 | * Names of columns representing fields in a Conversation. |
| 1082 | */ |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1083 | public static final class ConversationColumns { |
Mindy Pereira | 6349a04 | 2012-01-04 11:25:01 -0800 | [diff] [blame] | 1084 | public static final String URI = "conversationUri"; |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1085 | /** |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1086 | * This string column contains the content provider uri to return the |
| 1087 | * list of messages for this conversation. |
Paul Westbrook | 9cf4389 | 2012-03-15 15:43:47 -0700 | [diff] [blame] | 1088 | * The cursor returned by this query can return a {@link android.os.Bundle} |
| 1089 | * from a call to {@link android.database.Cursor#getExtras()}. This Bundle may have |
| 1090 | * values with keys listed in {@link CursorExtraKeys} |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1091 | */ |
| 1092 | public static final String MESSAGE_LIST_URI = "messageListUri"; |
Mindy Pereira | 27a0cf0 | 2011-12-22 13:16:32 -0800 | [diff] [blame] | 1093 | /** |
| 1094 | * This string column contains the subject string for a conversation. |
| 1095 | */ |
| 1096 | public static final String SUBJECT = "subject"; |
| 1097 | /** |
| 1098 | * This string column contains the snippet string for a conversation. |
| 1099 | */ |
| 1100 | public static final String SNIPPET = "snippet"; |
| 1101 | /** |
Mindy Pereira | 648df3f | 2012-07-19 09:20:26 -0700 | [diff] [blame] | 1102 | * @deprecated |
Mindy Pereira | 27a0cf0 | 2011-12-22 13:16:32 -0800 | [diff] [blame] | 1103 | */ |
Mark Wei | f6fac0a | 2013-02-11 20:58:17 -0800 | [diff] [blame] | 1104 | @Deprecated |
Mindy Pereira | 27a0cf0 | 2011-12-22 13:16:32 -0800 | [diff] [blame] | 1105 | public static final String SENDER_INFO = "senderInfo"; |
| 1106 | /** |
Andy Huang | 351ad4e | 2012-12-06 16:04:58 -0800 | [diff] [blame] | 1107 | * This blob column contains the byte-array representation of the Parceled |
| 1108 | * ConversationInfo object for a conversation. |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1109 | * |
| 1110 | * @deprecated providers should implement |
| 1111 | * {@link ConversationCursorCommand#COMMAND_GET_CONVERSATION_INFO} instead. |
Mindy Pereira | 648df3f | 2012-07-19 09:20:26 -0700 | [diff] [blame] | 1112 | */ |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1113 | @Deprecated |
Mindy Pereira | 648df3f | 2012-07-19 09:20:26 -0700 | [diff] [blame] | 1114 | public static final String CONVERSATION_INFO = "conversationInfo"; |
| 1115 | /** |
Mindy Pereira | 27a0cf0 | 2011-12-22 13:16:32 -0800 | [diff] [blame] | 1116 | * This long column contains the time in ms of the latest update to a |
| 1117 | * conversation. |
| 1118 | */ |
| 1119 | public static final String DATE_RECEIVED_MS = "dateReceivedMs"; |
| 1120 | |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1121 | /** |
| 1122 | * This boolean column contains whether any messages in this conversation |
| 1123 | * have attachments. |
| 1124 | */ |
| 1125 | public static final String HAS_ATTACHMENTS = "hasAttachments"; |
| 1126 | |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1127 | /** |
| 1128 | * This int column contains the number of messages in this conversation. |
| 1129 | * For unthreaded, this will always be 1. |
| 1130 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1131 | public static final String NUM_MESSAGES = "numMessages"; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1132 | |
| 1133 | /** |
| 1134 | * This int column contains the number of drafts associated with this |
| 1135 | * conversation. |
| 1136 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1137 | public static final String NUM_DRAFTS = "numDrafts"; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1138 | |
| 1139 | /** |
| 1140 | * This int column contains the state of drafts and replies associated |
| 1141 | * with this conversation. Use ConversationSendingState to interpret |
| 1142 | * this field. |
| 1143 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1144 | public static final String SENDING_STATE = "sendingState"; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1145 | |
| 1146 | /** |
| 1147 | * This int column contains the priority of this conversation. Use |
| 1148 | * ConversationPriority to interpret this field. |
| 1149 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1150 | public static final String PRIORITY = "priority"; |
Mindy Pereira | 4db59c5 | 2012-01-12 09:45:13 -0800 | [diff] [blame] | 1151 | |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1152 | /** |
Mindy Pereira | 87d535f | 2012-03-23 11:15:56 -0700 | [diff] [blame] | 1153 | * This int column indicates whether the conversation has been read |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1154 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1155 | public static final String READ = "read"; |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 1156 | |
| 1157 | /** |
| 1158 | * This int column indicates whether the conversation has been seen |
| 1159 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1160 | public static final String SEEN = "seen"; |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 1161 | |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1162 | /** |
Mindy Pereira | 87d535f | 2012-03-23 11:15:56 -0700 | [diff] [blame] | 1163 | * This int column indicates whether the conversation has been starred |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1164 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1165 | public static final String STARRED = "starred"; |
Marc Blank | c8a9942 | 2012-01-19 14:27:47 -0800 | [diff] [blame] | 1166 | |
Mindy Pereira | 36b6c8b | 2012-02-03 14:16:07 -0800 | [diff] [blame] | 1167 | /** |
Andy Huang | b2033d8 | 2012-12-07 19:30:57 -0800 | [diff] [blame] | 1168 | * This blob column contains the marshalled form of a Parceled |
| 1169 | * {@FolderList} object. Ideally, only ever use this for |
| 1170 | * rendering the folder list for a conversation. |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1171 | * |
| 1172 | * @deprecated providers should implement |
| 1173 | * {@link ConversationCursorCommand#COMMAND_GET_RAW_FOLDERS} instead. |
Mindy Pereira | cc8211d | 2012-03-12 10:35:37 -0700 | [diff] [blame] | 1174 | */ |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1175 | @Deprecated |
Mindy Pereira | 183718b | 2012-03-12 11:00:14 -0700 | [diff] [blame] | 1176 | public static final String RAW_FOLDERS = "rawFolders"; |
Mindy Pereira | 2265752 | 2012-03-14 13:27:59 -0700 | [diff] [blame] | 1177 | public static final String FLAGS = "conversationFlags"; |
Andy Huang | 1284fd6 | 2012-07-12 16:48:06 -0700 | [diff] [blame] | 1178 | /** |
| 1179 | * This int column indicates the personal level of a conversation per |
| 1180 | * {@link ConversationPersonalLevel}. |
| 1181 | */ |
Mindy Pereira | 2265752 | 2012-03-14 13:27:59 -0700 | [diff] [blame] | 1182 | public static final String PERSONAL_LEVEL = "personalLevel"; |
Mindy Pereira | 87d535f | 2012-03-23 11:15:56 -0700 | [diff] [blame] | 1183 | |
| 1184 | /** |
| 1185 | * This int column indicates whether the conversation is marked spam. |
| 1186 | */ |
| 1187 | public static final String SPAM = "spam"; |
| 1188 | |
| 1189 | /** |
Paul Westbrook | 76b2062 | 2012-07-12 11:45:43 -0700 | [diff] [blame] | 1190 | * This int column indicates whether the conversation is marked phishing. |
| 1191 | */ |
| 1192 | public static final String PHISHING = "phishing"; |
| 1193 | |
| 1194 | /** |
Mindy Pereira | 87d535f | 2012-03-23 11:15:56 -0700 | [diff] [blame] | 1195 | * This int column indicates whether the conversation was muted. |
| 1196 | */ |
| 1197 | public static final String MUTED = "muted"; |
| 1198 | |
Marc Blank | 92939fc | 2012-04-30 14:58:40 -0700 | [diff] [blame] | 1199 | /** |
| 1200 | * This int column contains a color for the conversation (used in Email only) |
| 1201 | */ |
| 1202 | public static final String COLOR = "color"; |
| 1203 | |
Marc Blank | a6b671d | 2012-05-25 12:52:02 -0700 | [diff] [blame] | 1204 | /** |
| 1205 | * This String column contains the Uri for this conversation's account |
| 1206 | */ |
| 1207 | public static final String ACCOUNT_URI = "accountUri"; |
Vikram Aggarwal | 66bc2aa | 2012-08-02 10:47:03 -0700 | [diff] [blame] | 1208 | /** |
Andy Huang | f98bc89 | 2012-08-07 18:22:09 -0700 | [diff] [blame] | 1209 | * This int column indicates whether a conversation is remote (non-local), and would require |
| 1210 | * a network fetch to load. |
| 1211 | */ |
| 1212 | public static final String REMOTE = "remote"; |
| 1213 | /** |
Vikram Aggarwal | 66bc2aa | 2012-08-02 10:47:03 -0700 | [diff] [blame] | 1214 | * This int column indicates whether the conversation was displayed on the UI and the |
| 1215 | * user got a chance to read it. The UI does not read this value, it is meant only to |
| 1216 | * write the status back to the provider. As a result, it is not available in the |
| 1217 | * {@link Conversation} object. |
| 1218 | */ |
Andy Huang | f98bc89 | 2012-08-07 18:22:09 -0700 | [diff] [blame] | 1219 | public static final String VIEWED = "viewed"; |
Paul Westbrook | 41dca18 | 2012-08-07 10:43:42 -0700 | [diff] [blame] | 1220 | /** |
| 1221 | * This String column contains the base uri for this conversation. This uri can be used |
| 1222 | * when handling relative urls in the message content |
| 1223 | */ |
| 1224 | public static final String CONVERSATION_BASE_URI = "conversationBaseUri"; |
| 1225 | |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 1226 | /** |
| 1227 | * This string column contains the uri of the first attachment preview of the first unread |
| 1228 | * message, denoted by UNREAD_MESSAGE_ID. |
| 1229 | */ |
| 1230 | public static final String ATTACHMENT_PREVIEW_URI0 = "attachmentPreviewUri0"; |
| 1231 | |
| 1232 | /** |
| 1233 | * This string column contains the uri of the second attachment preview of the first unread |
| 1234 | * message, denoted by UNREAD_MESSAGE_ID. |
| 1235 | */ |
| 1236 | public static final String ATTACHMENT_PREVIEW_URI1 = "attachmentPreviewUri1"; |
| 1237 | |
| 1238 | /** |
| 1239 | * This int column contains the states of the attachment previews of the first unread |
| 1240 | * message, the same message used for the snippet. The states is a packed int, |
| 1241 | * where the first and second bits represent the SIMPLE and BEST state of the first |
| 1242 | * attachment preview, while the third and fourth bits represent those states for the |
| 1243 | * second attachment preview. For each bit, a one means that rendition of that attachment |
| 1244 | * preview is downloaded. |
| 1245 | */ |
| 1246 | public static final String ATTACHMENT_PREVIEW_STATES = "attachmentPreviewStates"; |
| 1247 | |
| 1248 | /** |
| 1249 | * This int column contains the total count of images in the first unread message. The |
| 1250 | * total count may be higher than the number of ATTACHMENT_PREVIEW_URI columns. |
| 1251 | */ |
| 1252 | public static final String ATTACHMENT_PREVIEWS_COUNT = "attachmentPreviewsCount"; |
| 1253 | |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 1254 | private ConversationColumns() { |
Andy Huang | 732600e | 2012-01-10 17:47:17 -0800 | [diff] [blame] | 1255 | } |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1256 | } |
| 1257 | |
Andy Huang | ca85441 | 2012-04-20 19:55:38 -0700 | [diff] [blame] | 1258 | public static final class ConversationCursorCommand { |
| 1259 | |
| 1260 | public static final String COMMAND_RESPONSE_OK = "ok"; |
| 1261 | public static final String COMMAND_RESPONSE_FAILED = "failed"; |
| 1262 | |
| 1263 | /** |
Andy Huang | d521baf | 2013-05-21 18:08:08 -0700 | [diff] [blame] | 1264 | * Incoming bundles may include this key with an Integer bitfield value. See below for bit |
| 1265 | * values. |
| 1266 | */ |
| 1267 | public static final String COMMAND_KEY_OPTIONS = "options"; |
| 1268 | |
| 1269 | /** |
| 1270 | * Clients must set this bit when the {@link Cursor#respond(Bundle)} call is being used to |
| 1271 | * fetch a {@link Parcelable}. It serves as a hint that this call requires the cursor |
| 1272 | * position to first safely be moved. |
| 1273 | */ |
| 1274 | public static final int OPTION_MOVE_POSITION = 0x01; |
| 1275 | |
| 1276 | /** |
Paul Westbrook | 9f119c7 | 2012-04-24 16:10:59 -0700 | [diff] [blame] | 1277 | * This bundle key has a boolean value: true to indicate that this cursor has been shown |
| 1278 | * to the user. |
Vikram Aggarwal | 69b5c30 | 2012-09-05 11:11:13 -0700 | [diff] [blame] | 1279 | * <p> |
| 1280 | * A provider that implements this command should include this key in its response with a |
| 1281 | * value of {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. |
Paul Westbrook | 9f119c7 | 2012-04-24 16:10:59 -0700 | [diff] [blame] | 1282 | */ |
| 1283 | public static final String COMMAND_KEY_SET_VISIBILITY = "setVisibility"; |
| 1284 | |
Vikram Aggarwal | 69b5c30 | 2012-09-05 11:11:13 -0700 | [diff] [blame] | 1285 | /** |
| 1286 | * This key has a boolean value: true to indicate that this folder list is shown to the user |
| 1287 | * either on first call (launcher/widget/notification) or after switching from an existing |
| 1288 | * folder: Inbox -> Folder. Repeated calls are sent when switching back to the folder. Inbox |
| 1289 | * -> Folder -> Spam -> Folder will generate two calls to respond() with the value true for |
| 1290 | * "Folder". |
| 1291 | * <p> |
| 1292 | * A provider that implements this command should include the |
| 1293 | * {@link #COMMAND_KEY_SET_VISIBILITY} key in its response with a value of |
| 1294 | * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. This is <b>always</b> |
| 1295 | * set with {@link #COMMAND_KEY_SET_VISIBILITY} because this is only set when the folder |
| 1296 | * list is made visible. |
| 1297 | */ |
| 1298 | public static final String COMMAND_KEY_ENTERED_FOLDER = "enteredFolder"; |
| 1299 | |
Paul Westbrook | 983a723 | 2013-05-15 12:30:15 -0700 | [diff] [blame] | 1300 | /** |
| 1301 | * This key has an int value, indicating the position that the UI wants to notify the |
| 1302 | * provider that the data from a specified row is being shown to the user. |
| 1303 | * <p> |
| 1304 | * A provider that implements this command should include the |
| 1305 | * {@link #COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE} key in its response with a value of |
| 1306 | * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. |
| 1307 | */ |
| 1308 | public static final String COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE = "uiPositionChange"; |
| 1309 | |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1310 | /** |
| 1311 | * Rather than jamming a {@link ConversationInfo} into a byte-array blob to be read out of |
| 1312 | * a cursor, providers can optionally implement this command to directly return the object |
| 1313 | * in a Bundle. |
| 1314 | * <p> |
Andy Huang | fa225db | 2013-05-20 22:15:19 -0700 | [diff] [blame] | 1315 | * The requestor (UI code) will place a meaningless value in the request Bundle. The UI will |
| 1316 | * also move the cursor position to the desired place prior to calling respond(). Providers |
| 1317 | * should just use {@link Bundle#containsKey(String)} to check for this kind of request and |
| 1318 | * generate an object at the current cursor position. |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1319 | * <p> |
| 1320 | * A provider that implements this command should include the |
| 1321 | * {@link #COMMAND_GET_CONVERSATION_INFO} key in its response with a |
| 1322 | * {@link ConversationInfo} Parcelable object as its value. |
| 1323 | */ |
Andy Huang | f8b613c | 2013-05-24 15:20:44 -0700 | [diff] [blame] | 1324 | public static final String COMMAND_GET_CONVERSATION_INFO = |
| 1325 | ConversationColumns.CONVERSATION_INFO; |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1326 | |
| 1327 | /** |
| 1328 | * Rather than jamming a {@link FolderList} into a byte-array blob to be read out of |
| 1329 | * a cursor, providers can optionally implement this command to directly return the object |
| 1330 | * in a Bundle. |
| 1331 | * <p> |
Andy Huang | fa225db | 2013-05-20 22:15:19 -0700 | [diff] [blame] | 1332 | * The requestor (UI code) will place a meaningless value in the request Bundle. The UI will |
| 1333 | * also move the cursor position to the desired place prior to calling respond(). Providers |
| 1334 | * should just use {@link Bundle#containsKey(String)} to check for this kind of request and |
| 1335 | * generate an object at the current cursor position. |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1336 | * <p> |
| 1337 | * A provider that implements this command should include the |
| 1338 | * {@link #COMMAND_GET_RAW_FOLDERS} key in its response with a |
| 1339 | * {@link FolderList} Parcelable object as its value. |
| 1340 | */ |
Andy Huang | f8b613c | 2013-05-24 15:20:44 -0700 | [diff] [blame] | 1341 | public static final String COMMAND_GET_RAW_FOLDERS = ConversationColumns.RAW_FOLDERS; |
Andy Huang | 7f39bbd | 2013-05-20 20:36:38 -0700 | [diff] [blame] | 1342 | |
Andy Huang | ca85441 | 2012-04-20 19:55:38 -0700 | [diff] [blame] | 1343 | private ConversationCursorCommand() {} |
| 1344 | } |
| 1345 | |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1346 | /** |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 1347 | * List of operations that can can be performed on a conversation. These operations are applied |
| 1348 | * with {@link ContentProvider#update(Uri, ContentValues, String, String[])} |
| 1349 | * where the conversation uri is specified, and the ContentValues specifies the operation to |
| 1350 | * be performed. |
| 1351 | * <p/> |
| 1352 | * The operation to be performed is specified in the ContentValues by |
| 1353 | * the {@link ConversationOperations#OPERATION_KEY} |
| 1354 | * <p/> |
| 1355 | * Note not all UI providers will support these operations. {@link AccountCapabilities} can |
| 1356 | * be used to determine which operations are supported. |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1357 | */ |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 1358 | public static final class ConversationOperations { |
| 1359 | /** |
| 1360 | * ContentValues key used to specify the operation to be performed |
| 1361 | */ |
| 1362 | public static final String OPERATION_KEY = "operation"; |
| 1363 | |
| 1364 | /** |
| 1365 | * Archive operation |
| 1366 | */ |
| 1367 | public static final String ARCHIVE = "archive"; |
| 1368 | |
| 1369 | /** |
| 1370 | * Mute operation |
| 1371 | */ |
| 1372 | public static final String MUTE = "mute"; |
| 1373 | |
| 1374 | /** |
| 1375 | * Report spam operation |
| 1376 | */ |
| 1377 | public static final String REPORT_SPAM = "report_spam"; |
| 1378 | |
Paul Westbrook | 77eee62 | 2012-07-10 13:41:57 -0700 | [diff] [blame] | 1379 | /** |
| 1380 | * Report not spam operation |
| 1381 | */ |
| 1382 | public static final String REPORT_NOT_SPAM = "report_not_spam"; |
| 1383 | |
Paul Westbrook | 76b2062 | 2012-07-12 11:45:43 -0700 | [diff] [blame] | 1384 | /** |
| 1385 | * Report phishing operation |
| 1386 | */ |
| 1387 | public static final String REPORT_PHISHING = "report_phishing"; |
| 1388 | |
Paul Westbrook | ef36254 | 2012-08-27 14:53:32 -0700 | [diff] [blame] | 1389 | /** |
| 1390 | * Discard drafts operation |
| 1391 | */ |
| 1392 | public static final String DISCARD_DRAFTS = "discard_drafts"; |
| 1393 | |
mindyp | cb0b30e | 2012-11-30 10:16:35 -0800 | [diff] [blame] | 1394 | /** |
| 1395 | * Update conversation folder(s) operation. ContentValues passed as part |
| 1396 | * of this update will be of the format (FOLDERS_UPDATED, csv of updated |
| 1397 | * folders) where the comma separated values of the updated folders will |
| 1398 | * be of the format: folderuri/ADD_VALUE. ADD_VALUE will be true if the |
| 1399 | * folder was added, false if it was removed. |
| 1400 | */ |
| 1401 | public static final String FOLDERS_UPDATED = "folders_updated"; |
| 1402 | public static final String FOLDERS_UPDATED_SPLIT_PATTERN = ","; |
Paul Westbrook | 5109c51 | 2012-11-05 11:00:30 -0800 | [diff] [blame] | 1403 | |
| 1404 | public static final class Parameters { |
| 1405 | /** |
| 1406 | * Boolean indicating whether the undo for this operation should be suppressed |
| 1407 | */ |
| 1408 | public static final String SUPPRESS_UNDO = "suppress_undo"; |
| 1409 | |
| 1410 | private Parameters() {} |
| 1411 | } |
| 1412 | |
Paul Westbrook | 334e64a | 2012-02-23 13:26:35 -0800 | [diff] [blame] | 1413 | private ConversationOperations() { |
| 1414 | } |
| 1415 | } |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1416 | |
Paul Westbrook | 72e2ea8 | 2012-10-22 16:25:22 -0700 | [diff] [blame] | 1417 | /** |
| 1418 | * Methods that can be "called" using the account uri, through |
Tony Mantler | a7165dd | 2013-08-08 16:09:24 -0700 | [diff] [blame] | 1419 | * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} |
| 1420 | * Note, the arg parmateter of call should be the account uri. |
Paul Westbrook | 72e2ea8 | 2012-10-22 16:25:22 -0700 | [diff] [blame] | 1421 | */ |
| 1422 | public static final class AccountCallMethods { |
| 1423 | /** |
| 1424 | * Save message method. The Bundle for the call to |
Tony Mantler | a7165dd | 2013-08-08 16:09:24 -0700 | [diff] [blame] | 1425 | * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the |
| 1426 | * columns specified in {@link MessageColumns}, and if this is a save for an existing |
| 1427 | * message, an entry for the {@link MessageColumns#URI} should reference the existing |
| 1428 | * message |
Paul Westbrook | 72e2ea8 | 2012-10-22 16:25:22 -0700 | [diff] [blame] | 1429 | * |
| 1430 | * The Bundle returned will contain the message uri in the returned bundled with the |
| 1431 | * {@link MessageColumns#URI} key. |
| 1432 | */ |
| 1433 | public static final String SAVE_MESSAGE = "save_message"; |
| 1434 | |
| 1435 | /** |
| 1436 | * Send message method. The Bundle for the call to |
Tony Mantler | a7165dd | 2013-08-08 16:09:24 -0700 | [diff] [blame] | 1437 | * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the |
| 1438 | * columns specified in {@link MessageColumns}, and if this is a send of an existing |
| 1439 | * message, an entry for the {@link MessageColumns#URI} should reference the existing |
| 1440 | * message |
Paul Westbrook | 72e2ea8 | 2012-10-22 16:25:22 -0700 | [diff] [blame] | 1441 | * |
| 1442 | * The Bundle returned will contain the message uri in the returned bundled with the |
| 1443 | * {@link MessageColumns#URI} key. |
| 1444 | */ |
| 1445 | public static final String SEND_MESSAGE = "send_message"; |
| 1446 | |
Scott Banachowski | 53a615d | 2012-12-19 15:31:20 -0800 | [diff] [blame] | 1447 | /** |
| 1448 | * Change account method. The Bundle for the call to |
Tony Mantler | a7165dd | 2013-08-08 16:09:24 -0700 | [diff] [blame] | 1449 | * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the |
| 1450 | * columns specified in {@link SetCurrentAccountColumns} |
Scott Banachowski | 53a615d | 2012-12-19 15:31:20 -0800 | [diff] [blame] | 1451 | * |
| 1452 | * The Bundle returned will be empty. |
| 1453 | */ |
| 1454 | public static final String SET_CURRENT_ACCOUNT = "set_current_account"; |
| 1455 | |
Paul Westbrook | 72e2ea8 | 2012-10-22 16:25:22 -0700 | [diff] [blame] | 1456 | private AccountCallMethods() {} |
| 1457 | } |
| 1458 | |
Paul Westbrook | 3c7f94d | 2012-10-23 14:13:00 -0700 | [diff] [blame] | 1459 | /** |
| 1460 | * Keys used for parameters to {@link AccountCallMethods#SEND_MESSAGE} or |
| 1461 | * {@link AccountCallMethods#SAVE_MESSAGE} methods. |
| 1462 | */ |
| 1463 | public static final class SendOrSaveMethodParamKeys { |
| 1464 | /** |
| 1465 | * Bundle key used to store any opened file descriptors. |
| 1466 | * The keys of this Bundle are the contentUri for each attachment, and the |
| 1467 | * values are {@link android.os.ParcelFileDescriptor} objects. |
| 1468 | */ |
| 1469 | public static final String OPENED_FD_MAP = "opened_fds"; |
| 1470 | |
| 1471 | private SendOrSaveMethodParamKeys() {} |
| 1472 | } |
| 1473 | |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1474 | public static final class DraftType { |
Andy Huang | 97c25be | 2012-01-12 15:12:09 -0800 | [diff] [blame] | 1475 | public static final int NOT_A_DRAFT = 0; |
| 1476 | public static final int COMPOSE = 1; |
| 1477 | public static final int REPLY = 2; |
| 1478 | public static final int REPLY_ALL = 3; |
| 1479 | public static final int FORWARD = 4; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1480 | |
| 1481 | private DraftType() {} |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1482 | } |
| 1483 | |
Andrew Sapperstein | 3b08c51 | 2012-07-11 16:51:07 -0700 | [diff] [blame] | 1484 | /** |
| 1485 | * Class for the enum values to determine whether this |
| 1486 | * string should be displayed as a high priority warning |
| 1487 | * or a low priority warning. The current design has |
| 1488 | * high priority warnings in red while low priority warnings |
| 1489 | * are grey. |
| 1490 | */ |
| 1491 | public static final class SpamWarningLevel { |
| 1492 | public static final int NO_WARNING = 0; |
| 1493 | public static final int LOW_WARNING = 1; |
| 1494 | public static final int HIGH_WARNING = 2; |
| 1495 | |
| 1496 | private SpamWarningLevel() {} |
| 1497 | } |
| 1498 | |
| 1499 | /** |
| 1500 | * Class for the enum values to determine which type |
| 1501 | * of link to show in the spam warning. |
| 1502 | */ |
| 1503 | public static final class SpamWarningLinkType { |
| 1504 | public static final int NO_LINK = 0; |
| 1505 | public static final int IGNORE_WARNING = 1; |
| 1506 | public static final int REPORT_PHISHING = 2; |
| 1507 | |
| 1508 | private SpamWarningLinkType() {} |
| 1509 | } |
| 1510 | |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1511 | public static final String[] MESSAGE_PROJECTION = { |
| 1512 | BaseColumns._ID, |
Mindy Pereira | 326c660 | 2012-01-04 15:32:42 -0800 | [diff] [blame] | 1513 | MessageColumns.SERVER_ID, |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1514 | MessageColumns.URI, |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1515 | MessageColumns.CONVERSATION_ID, |
| 1516 | MessageColumns.SUBJECT, |
| 1517 | MessageColumns.SNIPPET, |
| 1518 | MessageColumns.FROM, |
| 1519 | MessageColumns.TO, |
| 1520 | MessageColumns.CC, |
| 1521 | MessageColumns.BCC, |
| 1522 | MessageColumns.REPLY_TO, |
| 1523 | MessageColumns.DATE_RECEIVED_MS, |
| 1524 | MessageColumns.BODY_HTML, |
| 1525 | MessageColumns.BODY_TEXT, |
| 1526 | MessageColumns.EMBEDS_EXTERNAL_RESOURCES, |
| 1527 | MessageColumns.REF_MESSAGE_ID, |
| 1528 | MessageColumns.DRAFT_TYPE, |
Mindy Pereira | 3ce64e7 | 2012-01-13 14:29:45 -0800 | [diff] [blame] | 1529 | MessageColumns.APPEND_REF_MESSAGE_CONTENT, |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1530 | MessageColumns.HAS_ATTACHMENTS, |
Mindy Pereira | 326c660 | 2012-01-04 15:32:42 -0800 | [diff] [blame] | 1531 | MessageColumns.ATTACHMENT_LIST_URI, |
Mindy Pereira | f944e96 | 2012-01-17 11:43:36 -0800 | [diff] [blame] | 1532 | MessageColumns.MESSAGE_FLAGS, |
Mindy Pereira | e8caf12 | 2012-03-20 15:23:31 -0700 | [diff] [blame] | 1533 | MessageColumns.ALWAYS_SHOW_IMAGES, |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 1534 | MessageColumns.READ, |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 1535 | MessageColumns.SEEN, |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 1536 | MessageColumns.STARRED, |
Andy Huang | 5a92907 | 2012-03-23 20:17:10 -0700 | [diff] [blame] | 1537 | MessageColumns.QUOTE_START_POS, |
Mindy Pereira | 92551d0 | 2012-04-05 11:31:12 -0700 | [diff] [blame] | 1538 | MessageColumns.ATTACHMENTS, |
Mindy Pereira | 62de1b1 | 2012-04-06 12:17:56 -0700 | [diff] [blame] | 1539 | MessageColumns.CUSTOM_FROM_ADDRESS, |
Marc Blank | 3842af9 | 2012-04-27 09:06:09 -0700 | [diff] [blame] | 1540 | MessageColumns.MESSAGE_ACCOUNT_URI, |
Andrew Sapperstein | 3b08c51 | 2012-07-11 16:51:07 -0700 | [diff] [blame] | 1541 | MessageColumns.EVENT_INTENT_URI, |
| 1542 | MessageColumns.SPAM_WARNING_STRING, |
| 1543 | MessageColumns.SPAM_WARNING_LEVEL, |
Andrew Sapperstein | d5b369b | 2012-07-13 12:38:46 -0700 | [diff] [blame] | 1544 | MessageColumns.SPAM_WARNING_LINK_TYPE, |
Andy Huang | 47aa9c9 | 2012-07-31 15:37:21 -0700 | [diff] [blame] | 1545 | MessageColumns.VIA_DOMAIN, |
| 1546 | MessageColumns.IS_SENDING |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1547 | }; |
| 1548 | |
Mindy Pereira | f944e96 | 2012-01-17 11:43:36 -0800 | [diff] [blame] | 1549 | /** Separates attachment info parts in strings in a message. */ |
Andy Huang | 5c5fd57 | 2012-04-08 18:19:29 -0700 | [diff] [blame] | 1550 | @Deprecated |
Mindy Pereira | f944e96 | 2012-01-17 11:43:36 -0800 | [diff] [blame] | 1551 | public static final String MESSAGE_ATTACHMENT_INFO_SEPARATOR = "\n"; |
Mindy Pereira | a140607 | 2011-12-22 10:54:06 -0800 | [diff] [blame] | 1552 | public static final String MESSAGE_LIST_TYPE = |
| 1553 | "vnd.android.cursor.dir/vnd.com.android.mail.message"; |
| 1554 | public static final String MESSAGE_TYPE = |
| 1555 | "vnd.android.cursor.item/vnd.com.android.mail.message"; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1556 | |
Mindy Pereira | 6349a04 | 2012-01-04 11:25:01 -0800 | [diff] [blame] | 1557 | public static final int MESSAGE_ID_COLUMN = 0; |
Mindy Pereira | 326c660 | 2012-01-04 15:32:42 -0800 | [diff] [blame] | 1558 | public static final int MESSAGE_SERVER_ID_COLUMN = 1; |
| 1559 | public static final int MESSAGE_URI_COLUMN = 2; |
Marc Blank | 26846d8 | 2012-03-22 18:12:54 -0700 | [diff] [blame] | 1560 | public static final int MESSAGE_CONVERSATION_URI_COLUMN = 3; |
Mindy Pereira | 326c660 | 2012-01-04 15:32:42 -0800 | [diff] [blame] | 1561 | public static final int MESSAGE_SUBJECT_COLUMN = 4; |
| 1562 | public static final int MESSAGE_SNIPPET_COLUMN = 5; |
| 1563 | public static final int MESSAGE_FROM_COLUMN = 6; |
| 1564 | public static final int MESSAGE_TO_COLUMN = 7; |
| 1565 | public static final int MESSAGE_CC_COLUMN = 8; |
| 1566 | public static final int MESSAGE_BCC_COLUMN = 9; |
| 1567 | public static final int MESSAGE_REPLY_TO_COLUMN = 10; |
| 1568 | public static final int MESSAGE_DATE_RECEIVED_MS_COLUMN = 11; |
Mindy Pereira | 1666816 | 2012-01-11 16:11:19 -0800 | [diff] [blame] | 1569 | public static final int MESSAGE_BODY_HTML_COLUMN = 12; |
| 1570 | public static final int MESSAGE_BODY_TEXT_COLUMN = 13; |
Mindy Pereira | 326c660 | 2012-01-04 15:32:42 -0800 | [diff] [blame] | 1571 | public static final int MESSAGE_EMBEDS_EXTERNAL_RESOURCES_COLUMN = 14; |
Alice Yang | a990a71 | 2013-03-13 18:37:00 -0700 | [diff] [blame] | 1572 | public static final int MESSAGE_REF_MESSAGE_URI_COLUMN = 15; |
Mindy Pereira | 326c660 | 2012-01-04 15:32:42 -0800 | [diff] [blame] | 1573 | public static final int MESSAGE_DRAFT_TYPE_COLUMN = 16; |
Mindy Pereira | 3ce64e7 | 2012-01-13 14:29:45 -0800 | [diff] [blame] | 1574 | public static final int MESSAGE_APPEND_REF_MESSAGE_CONTENT_COLUMN = 17; |
| 1575 | public static final int MESSAGE_HAS_ATTACHMENTS_COLUMN = 18; |
| 1576 | public static final int MESSAGE_ATTACHMENT_LIST_URI_COLUMN = 19; |
| 1577 | public static final int MESSAGE_FLAGS_COLUMN = 20; |
Paul Westbrook | ccf8194 | 2013-02-22 17:18:44 -0800 | [diff] [blame] | 1578 | public static final int MESSAGE_ALWAYS_SHOW_IMAGES_COLUMN = 21; |
| 1579 | public static final int MESSAGE_READ_COLUMN = 22; |
| 1580 | public static final int MESSAGE_SEEN_COLUMN = 23; |
| 1581 | public static final int MESSAGE_STARRED_COLUMN = 24; |
| 1582 | public static final int QUOTED_TEXT_OFFSET_COLUMN = 25; |
| 1583 | public static final int MESSAGE_ATTACHMENTS_COLUMN = 26; |
| 1584 | public static final int MESSAGE_CUSTOM_FROM_ADDRESS_COLUMN = 27; |
| 1585 | public static final int MESSAGE_ACCOUNT_URI_COLUMN = 28; |
| 1586 | public static final int MESSAGE_EVENT_INTENT_COLUMN = 29; |
| 1587 | public static final int MESSAGE_SPAM_WARNING_STRING_ID_COLUMN = 30; |
| 1588 | public static final int MESSAGE_SPAM_WARNING_LEVEL_COLUMN = 31; |
| 1589 | public static final int MESSAGE_SPAM_WARNING_LINK_TYPE_COLUMN = 32; |
| 1590 | public static final int MESSAGE_VIA_DOMAIN_COLUMN = 33; |
| 1591 | public static final int MESSAGE_IS_SENDING_COLUMN = 34; |
Paul Westbrook | 9cf4389 | 2012-03-15 15:43:47 -0700 | [diff] [blame] | 1592 | |
| 1593 | public static final class CursorStatus { |
| 1594 | // The cursor is actively loading more data |
| 1595 | public static final int LOADING = 1 << 0; |
| 1596 | |
| 1597 | // The cursor is currently not loading more data, but more data may be available |
| 1598 | public static final int LOADED = 1 << 1; |
| 1599 | |
| 1600 | // An error occured while loading data |
| 1601 | public static final int ERROR = 1 << 2; |
| 1602 | |
| 1603 | // The cursor is loaded, and there will be no more data |
| 1604 | public static final int COMPLETE = 1 << 3; |
Paul Westbrook | 573b9e6 | 2012-08-02 14:56:17 -0700 | [diff] [blame] | 1605 | |
| 1606 | public static boolean isWaitingForResults(int cursorStatus) { |
| 1607 | return 0 != (cursorStatus & LOADING); |
| 1608 | } |
Paul Westbrook | 9cf4389 | 2012-03-15 15:43:47 -0700 | [diff] [blame] | 1609 | } |
| 1610 | |
| 1611 | |
| 1612 | public static final class CursorExtraKeys { |
| 1613 | /** |
| 1614 | * This integer column contains the staus of the message cursor. The value will be |
| 1615 | * one defined in {@link CursorStatus}. |
| 1616 | */ |
Paul Westbrook | 7a3e657 | 2012-08-02 16:33:58 -0700 | [diff] [blame] | 1617 | public static final String EXTRA_STATUS = "cursor_status"; |
Paul Westbrook | 9cf4389 | 2012-03-15 15:43:47 -0700 | [diff] [blame] | 1618 | |
| 1619 | /** |
| 1620 | * Used for finding the cause of an error. |
| 1621 | * TODO: define these values |
| 1622 | */ |
Paul Westbrook | 7a3e657 | 2012-08-02 16:33:58 -0700 | [diff] [blame] | 1623 | public static final String EXTRA_ERROR = "cursor_error"; |
Paul Westbrook | 9cf4389 | 2012-03-15 15:43:47 -0700 | [diff] [blame] | 1624 | |
Yu Ping Hu | cbde5fa | 2013-03-04 21:57:04 -0800 | [diff] [blame] | 1625 | |
| 1626 | /** |
| 1627 | * This integer column contains the total message count for this folder. |
| 1628 | */ |
| 1629 | public static final String EXTRA_TOTAL_COUNT = "cursor_total_count"; |
Paul Westbrook | 9cf4389 | 2012-03-15 15:43:47 -0700 | [diff] [blame] | 1630 | } |
| 1631 | |
Paul Westbrook | 2388c5d | 2012-03-25 12:29:11 -0700 | [diff] [blame] | 1632 | public static final class AccountCursorExtraKeys { |
| 1633 | /** |
| 1634 | * This integer column contains the staus of the account cursor. The value will be |
| 1635 | * 1 if all accounts have been fully loaded or 0 if the account list hasn't been fully |
| 1636 | * initialized |
| 1637 | */ |
| 1638 | public static final String ACCOUNTS_LOADED = "accounts_loaded"; |
| 1639 | } |
| 1640 | |
Paul Westbrook | 9cf4389 | 2012-03-15 15:43:47 -0700 | [diff] [blame] | 1641 | |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1642 | public static final class MessageFlags { |
Andy Huang | 47aa9c9 | 2012-07-31 15:37:21 -0700 | [diff] [blame] | 1643 | public static final int REPLIED = 1 << 2; |
| 1644 | public static final int FORWARDED = 1 << 3; |
| 1645 | public static final int CALENDAR_INVITE = 1 << 4; |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1646 | } |
| 1647 | |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1648 | public static final class MessageColumns { |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1649 | /** |
| 1650 | * This string column contains a content provider URI that points to this single message. |
| 1651 | */ |
Mindy Pereira | 6349a04 | 2012-01-04 11:25:01 -0800 | [diff] [blame] | 1652 | public static final String URI = "messageUri"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1653 | /** |
| 1654 | * This string column contains a server-assigned ID for this message. |
| 1655 | */ |
| 1656 | public static final String SERVER_ID = "serverMessageId"; |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1657 | public static final String CONVERSATION_ID = "conversationId"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1658 | /** |
| 1659 | * This string column contains the subject of a message. |
| 1660 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1661 | public static final String SUBJECT = "subject"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1662 | /** |
| 1663 | * This string column contains a snippet of the message body. |
| 1664 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1665 | public static final String SNIPPET = "snippet"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1666 | /** |
| 1667 | * This string column contains the single email address (and optionally name) of the sender. |
| 1668 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1669 | public static final String FROM = "fromAddress"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1670 | /** |
| 1671 | * This string column contains a comma-delimited list of "To:" recipient email addresses. |
| 1672 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1673 | public static final String TO = "toAddresses"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1674 | /** |
| 1675 | * This string column contains a comma-delimited list of "CC:" recipient email addresses. |
| 1676 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1677 | public static final String CC = "ccAddresses"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1678 | /** |
| 1679 | * This string column contains a comma-delimited list of "BCC:" recipient email addresses. |
| 1680 | * This value will be null for incoming messages. |
| 1681 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1682 | public static final String BCC = "bccAddresses"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1683 | /** |
| 1684 | * This string column contains the single email address (and optionally name) of the |
| 1685 | * sender's reply-to address. |
| 1686 | */ |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1687 | public static final String REPLY_TO = "replyToAddress"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1688 | /** |
| 1689 | * This long column contains the timestamp (in millis) of receipt of the message. |
| 1690 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1691 | public static final String DATE_RECEIVED_MS = "dateReceivedMs"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1692 | /** |
| 1693 | * This string column contains the HTML form of the message body, if available. If not, |
| 1694 | * a provider must populate BODY_TEXT. |
| 1695 | */ |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1696 | public static final String BODY_HTML = "bodyHtml"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1697 | /** |
| 1698 | * This string column contains the plaintext form of the message body, if HTML is not |
| 1699 | * otherwise available. If HTML is available, this value should be left empty (null). |
| 1700 | */ |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1701 | public static final String BODY_TEXT = "bodyText"; |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1702 | public static final String EMBEDS_EXTERNAL_RESOURCES = "bodyEmbedsExternalResources"; |
Mindy Pereira | 3ce64e7 | 2012-01-13 14:29:45 -0800 | [diff] [blame] | 1703 | /** |
| 1704 | * This string column contains an opaque string used by the sendMessage api. |
| 1705 | */ |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1706 | public static final String REF_MESSAGE_ID = "refMessageId"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1707 | /** |
Andy Huang | 97c25be | 2012-01-12 15:12:09 -0800 | [diff] [blame] | 1708 | * This integer column contains the type of this draft, or zero (0) if this message is not a |
| 1709 | * draft. See {@link DraftType} for possible values. |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1710 | */ |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 1711 | public static final String DRAFT_TYPE = "draftType"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1712 | /** |
| 1713 | * This boolean column indicates whether an outgoing message should trigger special quoted |
| 1714 | * text processing upon send. The value should default to zero (0) for protocols that do |
| 1715 | * not support or require this flag, and for all incoming messages. |
| 1716 | */ |
Mindy Pereira | 3ce64e7 | 2012-01-13 14:29:45 -0800 | [diff] [blame] | 1717 | public static final String APPEND_REF_MESSAGE_CONTENT = "appendRefMessageContent"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1718 | /** |
| 1719 | * This boolean column indicates whether a message has attachments. The list of attachments |
| 1720 | * can be retrieved using the URI in {@link MessageColumns#ATTACHMENT_LIST_URI}. |
| 1721 | */ |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1722 | public static final String HAS_ATTACHMENTS = "hasAttachments"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1723 | /** |
Mindy Pereira | 7ed1c11 | 2012-01-18 10:59:25 -0800 | [diff] [blame] | 1724 | * This string column contains the content provider URI for the list of |
| 1725 | * attachments associated with this message. |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1726 | */ |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1727 | public static final String ATTACHMENT_LIST_URI = "attachmentListUri"; |
Andy Huang | db97747 | 2012-01-11 19:53:25 -0800 | [diff] [blame] | 1728 | /** |
| 1729 | * This long column is a bit field of flags defined in {@link MessageFlags}. |
| 1730 | */ |
Andy Huang | 732600e | 2012-01-10 17:47:17 -0800 | [diff] [blame] | 1731 | public static final String MESSAGE_FLAGS = "messageFlags"; |
Mindy Pereira | f944e96 | 2012-01-17 11:43:36 -0800 | [diff] [blame] | 1732 | /** |
Paul Westbrook | 104f729 | 2012-02-28 16:07:07 -0800 | [diff] [blame] | 1733 | * This integer column represents whether the user has specified that images should always |
| 1734 | * be shown. The value of "1" indicates that the user has specified that images should be |
| 1735 | * shown, while the value of "0" indicates that the user should be prompted before loading |
| 1736 | * any external images. |
| 1737 | */ |
| 1738 | public static final String ALWAYS_SHOW_IMAGES = "alwaysShowImages"; |
| 1739 | |
Mindy Pereira | e8caf12 | 2012-03-20 15:23:31 -0700 | [diff] [blame] | 1740 | /** |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 1741 | * This boolean column indicates whether the message has been read |
| 1742 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1743 | public static final String READ = "read"; |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 1744 | |
| 1745 | /** |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 1746 | * This boolean column indicates whether the message has been seen |
| 1747 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1748 | public static final String SEEN = "seen"; |
Scott Kennedy | d5edd2d | 2012-12-05 11:11:32 -0800 | [diff] [blame] | 1749 | |
| 1750 | /** |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 1751 | * This boolean column indicates whether the message has been starred |
| 1752 | */ |
Paul Westbrook | b891173 | 2013-04-28 11:54:49 -0700 | [diff] [blame] | 1753 | public static final String STARRED = "starred"; |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 1754 | |
| 1755 | /** |
Mindy Pereira | e8caf12 | 2012-03-20 15:23:31 -0700 | [diff] [blame] | 1756 | * This integer column represents the offset in the message of quoted |
| 1757 | * text. If include_quoted_text is zero, the value contained in this |
| 1758 | * column is invalid. |
| 1759 | */ |
| 1760 | public static final String QUOTE_START_POS = "quotedTextStartPos"; |
| 1761 | |
Andy Huang | 5a92907 | 2012-03-23 20:17:10 -0700 | [diff] [blame] | 1762 | /** |
| 1763 | * This string columns contains a JSON array of serialized {@link Attachment} objects. |
| 1764 | */ |
| 1765 | public static final String ATTACHMENTS = "attachments"; |
Mindy Pereira | 92551d0 | 2012-04-05 11:31:12 -0700 | [diff] [blame] | 1766 | public static final String CUSTOM_FROM_ADDRESS = "customFrom"; |
Mindy Pereira | 62de1b1 | 2012-04-06 12:17:56 -0700 | [diff] [blame] | 1767 | /** |
| 1768 | * Uri of the account associated with this message. Except in the case |
| 1769 | * of showing a combined view, this column is almost always empty. |
| 1770 | */ |
| 1771 | public static final String MESSAGE_ACCOUNT_URI = "messageAccountUri"; |
Marc Blank | 3842af9 | 2012-04-27 09:06:09 -0700 | [diff] [blame] | 1772 | /** |
Andy Huang | e623a0f | 2012-07-12 15:01:23 -0700 | [diff] [blame] | 1773 | * Intent Uri to launch when the user wants to view an event in their calendar, or null. |
Marc Blank | 3842af9 | 2012-04-27 09:06:09 -0700 | [diff] [blame] | 1774 | */ |
| 1775 | public static final String EVENT_INTENT_URI = "eventIntentUri"; |
Andrew Sapperstein | 3b08c51 | 2012-07-11 16:51:07 -0700 | [diff] [blame] | 1776 | /** |
Andrew Sapperstein | d5b369b | 2012-07-13 12:38:46 -0700 | [diff] [blame] | 1777 | * This string column contains the string for the spam |
Andrew Sapperstein | 3b08c51 | 2012-07-11 16:51:07 -0700 | [diff] [blame] | 1778 | * warning of this message, or null if there is no spam warning for the message. |
| 1779 | */ |
| 1780 | public static final String SPAM_WARNING_STRING = "spamWarningString"; |
| 1781 | /** |
| 1782 | * This integer column contains the level of spam warning of this message, |
| 1783 | * or zero (0) if this message does not have a warning level. |
| 1784 | * See {@link SpamWarningLevel} for possible values. |
| 1785 | */ |
| 1786 | public static final String SPAM_WARNING_LEVEL = "spamWarningLevel"; |
| 1787 | /** |
| 1788 | * This integer column contains the type of link for the spam warning |
| 1789 | * of this message, or zero (0) if this message does not have a link type. |
| 1790 | * See {@link SpamWarningLinkType} for possible values. |
| 1791 | */ |
| 1792 | public static final String SPAM_WARNING_LINK_TYPE = "spamWarningLinkType"; |
Andrew Sapperstein | d5b369b | 2012-07-13 12:38:46 -0700 | [diff] [blame] | 1793 | /** |
| 1794 | * This string column contains the string for the via domain |
| 1795 | * to be included if this message was sent via an alternate |
| 1796 | * domain. This column should be null if no via domain exists. |
| 1797 | */ |
| 1798 | public static final String VIA_DOMAIN = "viaDomain"; |
Andy Huang | 47aa9c9 | 2012-07-31 15:37:21 -0700 | [diff] [blame] | 1799 | /** |
| 1800 | * This boolean column indicates whether the message is an outgoing message in the process |
| 1801 | * of being sent (will be zero for incoming messages and messages that are already sent). |
| 1802 | */ |
| 1803 | public static final String IS_SENDING = "isSending"; |
Andrew Sapperstein | 3b08c51 | 2012-07-11 16:51:07 -0700 | [diff] [blame] | 1804 | |
Mindy Pereira | 6f92de6 | 2011-12-19 11:31:48 -0800 | [diff] [blame] | 1805 | private MessageColumns() {} |
| 1806 | } |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1807 | |
Scott Banachowski | 53a615d | 2012-12-19 15:31:20 -0800 | [diff] [blame] | 1808 | public static final class SetCurrentAccountColumns { |
| 1809 | /** |
| 1810 | * This column contains the Account object Parcelable. |
| 1811 | */ |
| 1812 | public static final String ACCOUNT = "account"; |
| 1813 | |
| 1814 | private SetCurrentAccountColumns() {} |
| 1815 | } |
| 1816 | |
Marc Blank | 922c3eb | 2012-04-24 08:41:53 -0700 | [diff] [blame] | 1817 | /** |
| 1818 | * List of operations that can can be performed on a message. These operations are applied |
| 1819 | * with {@link ContentProvider#update(Uri, ContentValues, String, String[])} |
| 1820 | * where the message uri is specified, and the ContentValues specifies the operation to |
| 1821 | * be performed, e.g. values.put(RESPOND_COLUMN, RESPOND_ACCEPT) |
| 1822 | * <p/> |
| 1823 | * Note not all UI providers will support these operations. |
| 1824 | */ |
| 1825 | public static final class MessageOperations { |
| 1826 | /** |
| 1827 | * Respond to a calendar invitation |
| 1828 | */ |
| 1829 | public static final String RESPOND_COLUMN = "respond"; |
| 1830 | |
| 1831 | public static final int RESPOND_ACCEPT = 1; |
| 1832 | public static final int RESPOND_TENTATIVE = 2; |
| 1833 | public static final int RESPOND_DECLINE = 3; |
| 1834 | |
| 1835 | private MessageOperations() { |
| 1836 | } |
| 1837 | } |
| 1838 | |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1839 | public static final String ATTACHMENT_LIST_TYPE = |
| 1840 | "vnd.android.cursor.dir/vnd.com.android.mail.attachment"; |
| 1841 | public static final String ATTACHMENT_TYPE = |
| 1842 | "vnd.android.cursor.item/vnd.com.android.mail.attachment"; |
| 1843 | |
| 1844 | public static final String[] ATTACHMENT_PROJECTION = { |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1845 | AttachmentColumns.NAME, |
| 1846 | AttachmentColumns.SIZE, |
Mindy Pereira | 7a07fb4 | 2012-01-11 10:32:48 -0800 | [diff] [blame] | 1847 | AttachmentColumns.URI, |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1848 | AttachmentColumns.CONTENT_TYPE, |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1849 | AttachmentColumns.STATE, |
| 1850 | AttachmentColumns.DESTINATION, |
| 1851 | AttachmentColumns.DOWNLOADED_SIZE, |
| 1852 | AttachmentColumns.CONTENT_URI, |
| 1853 | AttachmentColumns.THUMBNAIL_URI, |
Mark Wei | bbe74ae | 2012-11-19 11:20:09 -0800 | [diff] [blame] | 1854 | AttachmentColumns.PREVIEW_INTENT_URI, |
Andrew Sapperstein | 7434e80 | 2013-06-21 11:26:49 -0700 | [diff] [blame] | 1855 | AttachmentColumns.PROVIDER_DATA, |
Mark Wei | beaf1e4 | 2013-08-05 17:52:48 -0700 | [diff] [blame] | 1856 | AttachmentColumns.SUPPORTS_DOWNLOAD_AGAIN, |
Martin Hibdon | 519c218 | 2013-09-20 17:27:57 -0700 | [diff] [blame] | 1857 | AttachmentColumns.TYPE, |
| 1858 | AttachmentColumns.FLAGS |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1859 | }; |
Andy Huang | 109369d | 2012-03-07 20:05:31 -0800 | [diff] [blame] | 1860 | public static final int ATTACHMENT_NAME_COLUMN = 0; |
| 1861 | public static final int ATTACHMENT_SIZE_COLUMN = 1; |
| 1862 | public static final int ATTACHMENT_URI_COLUMN = 2; |
| 1863 | public static final int ATTACHMENT_CONTENT_TYPE_COLUMN = 3; |
| 1864 | public static final int ATTACHMENT_STATE_COLUMN = 4; |
| 1865 | public static final int ATTACHMENT_DESTINATION_COLUMN = 5; |
| 1866 | public static final int ATTACHMENT_DOWNLOADED_SIZE_COLUMN = 6; |
| 1867 | public static final int ATTACHMENT_CONTENT_URI_COLUMN = 7; |
| 1868 | public static final int ATTACHMENT_THUMBNAIL_URI_COLUMN = 8; |
| 1869 | public static final int ATTACHMENT_PREVIEW_INTENT_COLUMN = 9; |
Andrew Sapperstein | 7434e80 | 2013-06-21 11:26:49 -0700 | [diff] [blame] | 1870 | public static final int ATTACHMENT_SUPPORTS_DOWNLOAD_AGAIN_COLUMN = 10; |
Mark Wei | beaf1e4 | 2013-08-05 17:52:48 -0700 | [diff] [blame] | 1871 | public static final int ATTACHMENT_TYPE_COLUMN = 11; |
Martin Hibdon | 519c218 | 2013-09-20 17:27:57 -0700 | [diff] [blame] | 1872 | public static final int ATTACHMENT_FLAGS_COLUMN = 12; |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1873 | |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 1874 | /** Separates attachment info parts in strings in the database. */ |
| 1875 | public static final String ATTACHMENT_INFO_SEPARATOR = "\n"; // use to join |
| 1876 | public static final Pattern ATTACHMENT_INFO_SEPARATOR_PATTERN = |
| 1877 | Pattern.compile(ATTACHMENT_INFO_SEPARATOR); // use to split |
| 1878 | public static final String ATTACHMENT_INFO_DELIMITER = "|"; // use to join |
| 1879 | // use to split |
| 1880 | public static final Pattern ATTACHMENT_INFO_DELIMITER_PATTERN = Pattern.compile("\\|"); |
| 1881 | |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1882 | /** |
| 1883 | * Valid states for the {@link AttachmentColumns#STATE} column. |
| 1884 | * |
| 1885 | */ |
| 1886 | public static final class AttachmentState { |
| 1887 | /** |
| 1888 | * The full attachment is not present on device. When used as a command, |
| 1889 | * setting this state will tell the provider to cancel a download in |
| 1890 | * progress. |
| 1891 | * <p> |
Mark Wei | f6fac0a | 2013-02-11 20:58:17 -0800 | [diff] [blame] | 1892 | * Valid next states: {@link #DOWNLOADING}, {@link #PAUSED} |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1893 | */ |
| 1894 | public static final int NOT_SAVED = 0; |
| 1895 | /** |
| 1896 | * The most recent attachment download attempt failed. The current UI |
| 1897 | * design does not require providers to persist this state, but |
| 1898 | * providers must return this state at least once after a download |
| 1899 | * failure occurs. This state may not be used as a command. |
| 1900 | * <p> |
| 1901 | * Valid next states: {@link #DOWNLOADING} |
| 1902 | */ |
| 1903 | public static final int FAILED = 1; |
| 1904 | /** |
| 1905 | * The attachment is currently being downloaded by the provider. |
| 1906 | * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current |
| 1907 | * download progress while in this state. When used as a command, |
| 1908 | * setting this state will tell the provider to initiate a download to |
| 1909 | * the accompanying destination in {@link AttachmentColumns#DESTINATION} |
| 1910 | * . |
| 1911 | * <p> |
| 1912 | * Valid next states: {@link #NOT_SAVED}, {@link #FAILED}, |
| 1913 | * {@link #SAVED} |
| 1914 | */ |
| 1915 | public static final int DOWNLOADING = 2; |
| 1916 | /** |
| 1917 | * The attachment was successfully downloaded to the destination in |
| 1918 | * {@link AttachmentColumns#DESTINATION}. If a provider later detects |
| 1919 | * that a download is missing, it should reset the state to |
| 1920 | * {@link #NOT_SAVED}. This state may not be used as a command on its |
| 1921 | * own. To move a file from cache to external, update |
| 1922 | * {@link AttachmentColumns#DESTINATION}. |
| 1923 | * <p> |
Mark Wei | f6fac0a | 2013-02-11 20:58:17 -0800 | [diff] [blame] | 1924 | * Valid next states: {@link #NOT_SAVED}, {@link #PAUSED} |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1925 | */ |
| 1926 | public static final int SAVED = 3; |
Mark Wei | 47ca4e2 | 2012-10-17 16:20:15 -0700 | [diff] [blame] | 1927 | /** |
| 1928 | * This is only used as a command, not as a state. The attachment is |
| 1929 | * currently being redownloaded by the provider. |
| 1930 | * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current |
| 1931 | * download progress while in this state. When used as a command, |
| 1932 | * setting this state will tell the provider to initiate a download to |
| 1933 | * the accompanying destination in {@link AttachmentColumns#DESTINATION} |
| 1934 | * . |
Mark Wei | 47ca4e2 | 2012-10-17 16:20:15 -0700 | [diff] [blame] | 1935 | */ |
| 1936 | public static final int REDOWNLOADING = 4; |
Mark Wei | 7bed4bc | 2013-01-22 22:56:22 -0800 | [diff] [blame] | 1937 | /** |
| 1938 | * The attachment is either pending or paused in the download manager. |
| 1939 | * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current |
| 1940 | * download progress while in this state. This state may not be used as |
| 1941 | * a command on its own. |
| 1942 | * <p> |
| 1943 | * Valid next states: {@link #DOWNLOADING}, {@link #FAILED} |
| 1944 | */ |
| 1945 | public static final int PAUSED = 5; |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1946 | |
| 1947 | private AttachmentState() {} |
| 1948 | } |
| 1949 | |
| 1950 | public static final class AttachmentDestination { |
| 1951 | |
| 1952 | /** |
| 1953 | * The attachment will be or is already saved to the app-private cache partition. |
| 1954 | */ |
| 1955 | public static final int CACHE = 0; |
| 1956 | /** |
| 1957 | * The attachment will be or is already saved to external shared device storage. |
Mark Wei | 5b49ce3 | 2013-02-08 16:31:16 -0800 | [diff] [blame] | 1958 | * This value should be 1 since saveToSd is often used in a similar way |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1959 | */ |
| 1960 | public static final int EXTERNAL = 1; |
| 1961 | |
| 1962 | private AttachmentDestination() {} |
| 1963 | } |
| 1964 | |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1965 | public static final class AttachmentColumns { |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1966 | /** |
| 1967 | * This string column is the attachment's file name, intended for display in UI. It is not |
| 1968 | * the full path of the file. |
| 1969 | */ |
Paul Westbrook | c97d8ac | 2012-03-23 15:21:48 -0700 | [diff] [blame] | 1970 | public static final String NAME = OpenableColumns.DISPLAY_NAME; |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1971 | /** |
| 1972 | * This integer column is the file size of the attachment, in bytes. |
| 1973 | */ |
Paul Westbrook | c97d8ac | 2012-03-23 15:21:48 -0700 | [diff] [blame] | 1974 | public static final String SIZE = OpenableColumns.SIZE; |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1975 | /** |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 1976 | * This column is a {@link android.net.Uri} that can be queried to |
| 1977 | * monitor download state and progress for this individual attachment |
| 1978 | * (resulting cursor has one single row for this attachment). |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1979 | */ |
Mindy Pereira | 7a07fb4 | 2012-01-11 10:32:48 -0800 | [diff] [blame] | 1980 | public static final String URI = "uri"; |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1981 | /** |
| 1982 | * This string column is the MIME type of the attachment. |
| 1983 | */ |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 1984 | public static final String CONTENT_TYPE = "contentType"; |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1985 | /** |
| 1986 | * This integer column is the current downloading state of the |
| 1987 | * attachment as defined in {@link AttachmentState}. |
| 1988 | * <p> |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 1989 | * Providers must accept updates to {@link #URI} with new values of |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 1990 | * this column to initiate or cancel downloads. |
| 1991 | */ |
| 1992 | public static final String STATE = "state"; |
| 1993 | /** |
| 1994 | * This integer column is the file destination for the current download |
| 1995 | * in progress (when {@link #STATE} is |
| 1996 | * {@link AttachmentState#DOWNLOADING}) or the resulting downloaded file |
| 1997 | * ( when {@link #STATE} is {@link AttachmentState#SAVED}), as defined |
| 1998 | * in {@link AttachmentDestination}. This value is undefined in any |
| 1999 | * other state. |
| 2000 | * <p> |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 2001 | * Providers must accept updates to {@link #URI} with new values of |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 2002 | * this column to move an existing downloaded file. |
| 2003 | */ |
| 2004 | public static final String DESTINATION = "destination"; |
| 2005 | /** |
| 2006 | * This integer column is the current number of bytes downloaded when |
| 2007 | * {@link #STATE} is {@link AttachmentState#DOWNLOADING}. This value is |
| 2008 | * undefined in any other state. |
| 2009 | */ |
| 2010 | public static final String DOWNLOADED_SIZE = "downloadedSize"; |
| 2011 | /** |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2012 | * This column is a {@link android.net.Uri} that points to the |
| 2013 | * downloaded local file when {@link #STATE} is |
| 2014 | * {@link AttachmentState#SAVED}. This value is undefined in any other |
| 2015 | * state. |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 2016 | */ |
| 2017 | public static final String CONTENT_URI = "contentUri"; |
| 2018 | /** |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2019 | * This column is a {@link android.net.Uri} that points to a local |
| 2020 | * thumbnail file for the attachment. Providers that do not support |
| 2021 | * downloading attachment thumbnails may leave this null. |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 2022 | */ |
| 2023 | public static final String THUMBNAIL_URI = "thumbnailUri"; |
| 2024 | /** |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2025 | * This column is an {@link android.net.Uri} used in an |
| 2026 | * {@link android.content.Intent#ACTION_VIEW} Intent to launch a preview |
| 2027 | * activity that allows the user to efficiently view an attachment |
| 2028 | * without having to first download the entire file. Providers that do |
| 2029 | * not support previewing attachments may leave this null. |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 2030 | */ |
Paul Westbrook | d49db8e | 2012-08-03 17:58:46 -0700 | [diff] [blame] | 2031 | public static final String PREVIEW_INTENT_URI = "previewIntentUri"; |
Mark Wei | bbe74ae | 2012-11-19 11:20:09 -0800 | [diff] [blame] | 2032 | /** |
| 2033 | * This column contains provider-specific private data as JSON string. |
| 2034 | */ |
| 2035 | public static final String PROVIDER_DATA = "providerData"; |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 2036 | |
Andrew Sapperstein | 7434e80 | 2013-06-21 11:26:49 -0700 | [diff] [blame] | 2037 | /** |
Mark Wei | beaf1e4 | 2013-08-05 17:52:48 -0700 | [diff] [blame] | 2038 | * This column represents whether this attachment supports the ability to be downloaded |
| 2039 | * again. |
Andrew Sapperstein | 7434e80 | 2013-06-21 11:26:49 -0700 | [diff] [blame] | 2040 | */ |
| 2041 | public static final String SUPPORTS_DOWNLOAD_AGAIN = "supportsDownloadAgain"; |
Mark Wei | beaf1e4 | 2013-08-05 17:52:48 -0700 | [diff] [blame] | 2042 | /** |
| 2043 | * This column represents the visibility type of this attachment. One of the |
| 2044 | * {@link AttachmentType} constants. |
| 2045 | */ |
| 2046 | public static final String TYPE = "type"; |
Andrew Sapperstein | 7434e80 | 2013-06-21 11:26:49 -0700 | [diff] [blame] | 2047 | |
Martin Hibdon | 519c218 | 2013-09-20 17:27:57 -0700 | [diff] [blame] | 2048 | /** |
| 2049 | * This column holds various bitwise flags for status information. |
| 2050 | */ |
| 2051 | public static final String FLAGS = "flags"; |
| 2052 | |
Andy Huang | e0b83b8 | 2012-03-06 19:57:04 -0800 | [diff] [blame] | 2053 | private AttachmentColumns() {} |
Mindy Pereira | f30cc09 | 2011-12-29 14:02:40 -0800 | [diff] [blame] | 2054 | } |
Mindy Pereira | 013194c | 2012-01-06 15:09:33 -0800 | [diff] [blame] | 2055 | |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2056 | public static final class AttachmentContentValueKeys { |
| 2057 | public static final String RENDITION = "rendition"; |
Mark Wei | 2674535 | 2013-01-17 21:40:34 -0800 | [diff] [blame] | 2058 | public static final String ADDITIONAL_PRIORITY = "additionalPriority"; |
| 2059 | public static final String DELAY_DOWNLOAD = "delayDownload"; |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2060 | } |
| 2061 | |
| 2062 | /** |
| 2063 | * Indicates a version of an attachment. |
| 2064 | */ |
| 2065 | public static final class AttachmentRendition { |
| 2066 | |
| 2067 | /** A smaller or simpler version of the attachment, such as a scaled-down image or an HTML |
| 2068 | * version of a document. Not always available. |
| 2069 | */ |
| 2070 | public static final int SIMPLE = 0; |
| 2071 | /** |
| 2072 | * The full version of an attachment if it can be handled on the device, otherwise the |
| 2073 | * preview. |
| 2074 | */ |
| 2075 | public static final int BEST = 1; |
| 2076 | |
Mark Wei | 7df813e | 2013-03-12 15:11:17 -0700 | [diff] [blame] | 2077 | private static final String SIMPLE_STRING = "SIMPLE"; |
| 2078 | private static final String BEST_STRING = "BEST"; |
| 2079 | |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 2080 | /** |
| 2081 | * Prefer renditions in this order. |
| 2082 | */ |
| 2083 | public static final int[] PREFERRED_RENDITIONS = new int[]{BEST, SIMPLE}; |
| 2084 | |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2085 | public static int parseRendition(String rendition) { |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 2086 | if (TextUtils.equals(rendition, SIMPLE_STRING)) { |
| 2087 | return SIMPLE; |
| 2088 | } else if (TextUtils.equals(rendition, BEST_STRING)) { |
| 2089 | return BEST; |
| 2090 | } |
| 2091 | |
| 2092 | throw new IllegalArgumentException(String.format("Unknown rendition %s", rendition)); |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2093 | } |
| 2094 | |
| 2095 | public static String toString(int rendition) { |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 2096 | if (rendition == BEST) { |
| 2097 | return BEST_STRING; |
| 2098 | } else if (rendition == SIMPLE) { |
| 2099 | return SIMPLE_STRING; |
| 2100 | } |
| 2101 | |
| 2102 | throw new IllegalArgumentException(String.format("Unknown rendition %d", rendition)); |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 2103 | } |
| 2104 | } |
| 2105 | |
Mark Wei | beaf1e4 | 2013-08-05 17:52:48 -0700 | [diff] [blame] | 2106 | /** |
| 2107 | * Indicates the visibility type of an attachment. |
| 2108 | */ |
| 2109 | public static final class AttachmentType { |
| 2110 | public static final int STANDARD = 0; |
| 2111 | public static final int INLINE_CURRENT_MESSAGE = 1; |
| 2112 | public static final int INLINE_QUOTED_MESSAGE = 2; |
| 2113 | } |
| 2114 | |
Marc Blank | b31ab5a | 2012-02-01 12:28:29 -0800 | [diff] [blame] | 2115 | public static final String[] UNDO_PROJECTION = { |
| 2116 | ConversationColumns.MESSAGE_LIST_URI |
| 2117 | }; |
| 2118 | public static final int UNDO_MESSAGE_LIST_COLUMN = 0; |
Marc Blank | dd10bc8 | 2012-02-01 19:10:46 -0800 | [diff] [blame] | 2119 | |
| 2120 | // Parameter used to indicate the sequence number for an undoable operation |
| 2121 | public static final String SEQUENCE_QUERY_PARAMETER = "seq"; |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2122 | |
Scott Kennedy | 1007e70 | 2012-12-20 11:18:45 -0800 | [diff] [blame] | 2123 | /** |
| 2124 | * Parameter used to force UI notifications in an operation involving |
| 2125 | * {@link ConversationOperations#OPERATION_KEY}. |
| 2126 | */ |
| 2127 | public static final String FORCE_UI_NOTIFICATIONS_QUERY_PARAMETER = "forceUiNotifications"; |
| 2128 | |
Scott Kennedy | dd2ec68 | 2013-06-03 19:16:13 -0700 | [diff] [blame] | 2129 | /** |
| 2130 | * Parameter used to allow returning hidden folders. |
| 2131 | */ |
| 2132 | public static final String ALLOW_HIDDEN_FOLDERS_QUERY_PARAM = "allowHiddenFolders"; |
| 2133 | |
Scott Kennedy | 0d0f8b0 | 2012-10-12 15:18:18 -0700 | [diff] [blame] | 2134 | public static final String AUTO_ADVANCE_MODE_OLDER = "older"; |
| 2135 | public static final String AUTO_ADVANCE_MODE_NEWER = "newer"; |
| 2136 | public static final String AUTO_ADVANCE_MODE_LIST = "list"; |
| 2137 | |
Vikram Aggarwal | c769422 | 2012-04-23 13:37:01 -0700 | [diff] [blame] | 2138 | /** |
| 2139 | * Settings for auto advancing when the current conversation has been destroyed. |
| 2140 | */ |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2141 | public static final class AutoAdvance { |
Vikram Aggarwal | c769422 | 2012-04-23 13:37:01 -0700 | [diff] [blame] | 2142 | /** No setting specified. */ |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2143 | public static final int UNSET = 0; |
Vikram Aggarwal | c769422 | 2012-04-23 13:37:01 -0700 | [diff] [blame] | 2144 | /** Go to the older message (if available) */ |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2145 | public static final int OLDER = 1; |
Vikram Aggarwal | c769422 | 2012-04-23 13:37:01 -0700 | [diff] [blame] | 2146 | /** Go to the newer message (if available) */ |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2147 | public static final int NEWER = 2; |
Vikram Aggarwal | c769422 | 2012-04-23 13:37:01 -0700 | [diff] [blame] | 2148 | /** Go back to conversation list*/ |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2149 | public static final int LIST = 3; |
Vikram Aggarwal | 82d3750 | 2013-01-10 16:18:49 -0800 | [diff] [blame] | 2150 | /** The default option is to go to the list */ |
| 2151 | public static final int DEFAULT = LIST; |
Scott Kennedy | 0d0f8b0 | 2012-10-12 15:18:18 -0700 | [diff] [blame] | 2152 | |
| 2153 | /** |
| 2154 | * Gets the int value for the given auto advance setting. |
| 2155 | * |
| 2156 | * @param autoAdvanceSetting The string setting, such as "newer", "older", "list" |
| 2157 | */ |
| 2158 | public static int getAutoAdvanceInt(final String autoAdvanceSetting) { |
| 2159 | final int autoAdvance; |
| 2160 | |
| 2161 | if (AUTO_ADVANCE_MODE_NEWER.equals(autoAdvanceSetting)) { |
| 2162 | autoAdvance = UIProvider.AutoAdvance.NEWER; |
| 2163 | } else if (AUTO_ADVANCE_MODE_OLDER.equals(autoAdvanceSetting)) { |
| 2164 | autoAdvance = UIProvider.AutoAdvance.OLDER; |
| 2165 | } else if (AUTO_ADVANCE_MODE_LIST.equals(autoAdvanceSetting)) { |
| 2166 | autoAdvance = UIProvider.AutoAdvance.LIST; |
| 2167 | } else { |
| 2168 | autoAdvance = UIProvider.AutoAdvance.UNSET; |
| 2169 | } |
| 2170 | |
| 2171 | return autoAdvance; |
| 2172 | } |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2173 | } |
| 2174 | |
Mindy Pereira | 71a8f5e | 2012-07-25 14:33:18 -0700 | [diff] [blame] | 2175 | /** |
| 2176 | * Settings for what swipe should do. |
| 2177 | */ |
| 2178 | public static final class Swipe { |
| 2179 | /** Archive or remove label, if available. */ |
| 2180 | public static final int ARCHIVE = 0; |
| 2181 | /** Delete */ |
| 2182 | public static final int DELETE = 1; |
| 2183 | /** No swipe */ |
| 2184 | public static final int DISABLED = 2; |
Mindy Pereira | e58222b | 2012-07-25 14:33:18 -0700 | [diff] [blame] | 2185 | /** Default is delete */ |
Mindy Pereira | 1c605fe | 2012-07-25 16:17:15 -0700 | [diff] [blame] | 2186 | public static final int DEFAULT = ARCHIVE; |
Mindy Pereira | 71a8f5e | 2012-07-25 14:33:18 -0700 | [diff] [blame] | 2187 | } |
| 2188 | |
Paul Westbrook | fa255c0 | 2012-10-13 14:32:52 -0700 | [diff] [blame] | 2189 | /** |
| 2190 | * Settings for Conversation view mode. |
| 2191 | */ |
| 2192 | public static final class ConversationViewMode { |
| 2193 | /** |
| 2194 | * The user hasn't specified a mode. |
| 2195 | */ |
| 2196 | public static final int UNDEFINED = -1; |
| 2197 | /** |
| 2198 | * Default to fit the conversation to screen view |
| 2199 | */ |
| 2200 | public static final int OVERVIEW = 0; |
| 2201 | /** |
| 2202 | * Conversation text size should be the device default, and wide conversations may |
| 2203 | * require panning |
| 2204 | */ |
| 2205 | public static final int READING = 1; |
Andy Huang | ccf6780 | 2013-03-15 14:31:57 -0700 | [diff] [blame] | 2206 | public static final int DEFAULT = OVERVIEW; |
Paul Westbrook | fa255c0 | 2012-10-13 14:32:52 -0700 | [diff] [blame] | 2207 | } |
| 2208 | |
Paul Westbrook | 63eef79 | 2012-02-27 14:01:06 -0800 | [diff] [blame] | 2209 | public static final class SnapHeaderValue { |
| 2210 | public static final int ALWAYS = 0; |
| 2211 | public static final int PORTRAIT_ONLY = 1; |
| 2212 | public static final int NEVER = 2; |
| 2213 | } |
| 2214 | |
| 2215 | public static final class MessageTextSize { |
| 2216 | public static final int TINY = -2; |
| 2217 | public static final int SMALL = -1; |
| 2218 | public static final int NORMAL = 0; |
| 2219 | public static final int LARGE = 1; |
| 2220 | public static final int HUGE = 2; |
| 2221 | } |
| 2222 | |
| 2223 | public static final class DefaultReplyBehavior { |
| 2224 | public static final int REPLY = 0; |
| 2225 | public static final int REPLY_ALL = 1; |
| 2226 | } |
| 2227 | |
Paul Westbrook | ee0fda7 | 2012-03-19 10:13:36 -0700 | [diff] [blame] | 2228 | /** |
Alice Yang | 4758e98 | 2013-04-24 20:31:34 -0700 | [diff] [blame] | 2229 | * Setting for whether to show sender images in conversation list. |
Alice Yang | 6427314 | 2013-04-10 18:26:56 -0700 | [diff] [blame] | 2230 | */ |
| 2231 | public static final class ConversationListIcon { |
Alice Yang | 6427314 | 2013-04-10 18:26:56 -0700 | [diff] [blame] | 2232 | public static final int SENDER_IMAGE = 1; |
| 2233 | public static final int NONE = 2; |
Alice Yang | f5ffaee | 2013-04-23 16:23:10 -0700 | [diff] [blame] | 2234 | public static final int DEFAULT = 1; // Default to show sender image |
Alice Yang | 6427314 | 2013-04-10 18:26:56 -0700 | [diff] [blame] | 2235 | } |
| 2236 | |
| 2237 | /** |
Marc Blank | bc6ba05 | 2012-03-19 10:46:07 -0700 | [diff] [blame] | 2238 | * Action for an intent used to update/create new notifications. The mime type of this |
Paul Westbrook | ee0fda7 | 2012-03-19 10:13:36 -0700 | [diff] [blame] | 2239 | * intent should be set to the mimeType of the account that is generating this notification. |
| 2240 | * An intent of this action is required to have the following extras: |
Andy Huang | d8e249e | 2012-03-21 17:01:37 -0700 | [diff] [blame] | 2241 | * {@link UpdateNotificationExtras#EXTRA_FOLDER} {@link UpdateNotificationExtras#EXTRA_ACCOUNT} |
Paul Westbrook | ee0fda7 | 2012-03-19 10:13:36 -0700 | [diff] [blame] | 2242 | */ |
| 2243 | public static final String ACTION_UPDATE_NOTIFICATION = |
| 2244 | "com.android.mail.action.update_notification"; |
| 2245 | |
Marc Blank | bc6ba05 | 2012-03-19 10:46:07 -0700 | [diff] [blame] | 2246 | public static final class UpdateNotificationExtras { |
| 2247 | /** |
Paul Westbrook | 6ead20d | 2012-03-19 14:48:14 -0700 | [diff] [blame] | 2248 | * Parcelable extra containing a {@link Uri} to a {@link Folder} |
Marc Blank | bc6ba05 | 2012-03-19 10:46:07 -0700 | [diff] [blame] | 2249 | */ |
| 2250 | public static final String EXTRA_FOLDER = "notification_extra_folder"; |
Paul Westbrook | ee0fda7 | 2012-03-19 10:13:36 -0700 | [diff] [blame] | 2251 | |
Marc Blank | bc6ba05 | 2012-03-19 10:46:07 -0700 | [diff] [blame] | 2252 | /** |
Paul Westbrook | 6ead20d | 2012-03-19 14:48:14 -0700 | [diff] [blame] | 2253 | * Parcelable extra containing a {@link Uri} to an {@link Account} |
Marc Blank | bc6ba05 | 2012-03-19 10:46:07 -0700 | [diff] [blame] | 2254 | */ |
| 2255 | public static final String EXTRA_ACCOUNT = "notification_extra_account"; |
Paul Westbrook | 6ead20d | 2012-03-19 14:48:14 -0700 | [diff] [blame] | 2256 | |
| 2257 | /** |
| 2258 | * Integer extra containing the update unread count for the account/folder. |
| 2259 | * If this value is 0, the UI will not block the intent to allow code to clear notifications |
| 2260 | * to run. |
| 2261 | */ |
| 2262 | public static final String EXTRA_UPDATED_UNREAD_COUNT = "notification_updated_unread_count"; |
Tony Mantler | 81d0056 | 2013-11-21 12:26:01 -0800 | [diff] [blame^] | 2263 | |
| 2264 | /** |
| 2265 | * Integer extra containing the update unseen count for the account/folder. |
| 2266 | */ |
| 2267 | public static final String EXTRA_UPDATED_UNSEEN_COUNT = "notification_updated_unseen_count"; |
Marc Blank | bc6ba05 | 2012-03-19 10:46:07 -0700 | [diff] [blame] | 2268 | } |
Paul Westbrook | e550355 | 2012-03-28 00:35:57 -0700 | [diff] [blame] | 2269 | |
| 2270 | public static final class EditSettingsExtras { |
| 2271 | /** |
| 2272 | * Parcelable extra containing account for which the user wants to |
| 2273 | * modify settings |
| 2274 | */ |
| 2275 | public static final String EXTRA_ACCOUNT = "extra_account"; |
| 2276 | |
| 2277 | /** |
| 2278 | * Parcelable extra containing folder for which the user wants to |
| 2279 | * modify settings |
| 2280 | */ |
| 2281 | public static final String EXTRA_FOLDER = "extra_folder"; |
Paul Westbrook | 18babd2 | 2012-04-09 22:17:08 -0700 | [diff] [blame] | 2282 | |
| 2283 | /** |
| 2284 | * Boolean extra which is set true if the user wants to "manage folders" |
| 2285 | */ |
| 2286 | public static final String EXTRA_MANAGE_FOLDERS = "extra_manage_folders"; |
Paul Westbrook | e550355 | 2012-03-28 00:35:57 -0700 | [diff] [blame] | 2287 | } |
Paul Westbrook | 17beb0b | 2012-08-20 13:34:37 -0700 | [diff] [blame] | 2288 | |
| 2289 | public static final class SendFeedbackExtras { |
| 2290 | /** |
| 2291 | * Optional boolean extras which indicates that the user is reporting a problem. |
| 2292 | */ |
| 2293 | public static final String EXTRA_REPORTING_PROBLEM = "reporting_problem"; |
Paul Westbrook | 83e6b57 | 2013-02-05 16:22:42 -0800 | [diff] [blame] | 2294 | /** |
| 2295 | * Optional Parcelable extra containing the screenshot of the screen where the user |
| 2296 | * is reporting a problem. |
| 2297 | */ |
| 2298 | public static final String EXTRA_SCREEN_SHOT = "screen_shot"; |
Paul Westbrook | 17beb0b | 2012-08-20 13:34:37 -0700 | [diff] [blame] | 2299 | } |
Mark Wei | 9982fdb | 2012-08-30 18:27:46 -0700 | [diff] [blame] | 2300 | |
| 2301 | public static final class ViewProxyExtras { |
| 2302 | /** |
| 2303 | * Uri extra passed to the proxy which indicates the original Uri that was intended to be |
| 2304 | * viewed. |
| 2305 | */ |
| 2306 | public static final String EXTRA_ORIGINAL_URI = "original_uri"; |
| 2307 | /** |
| 2308 | * Parcelable extra passed to the proxy which indicates the account being viewed from. |
| 2309 | */ |
| 2310 | public static final String EXTRA_ACCOUNT = "account"; |
| 2311 | /** |
| 2312 | * String extra passed from the proxy which indicates the salt used to generate the digest. |
| 2313 | */ |
| 2314 | public static final String EXTRA_SALT = "salt"; |
| 2315 | /** |
| 2316 | * Byte[] extra passed from the proxy which indicates the digest of the salted account name. |
| 2317 | */ |
| 2318 | public static final String EXTRA_ACCOUNT_DIGEST = "digest"; |
| 2319 | } |
Paul Westbrook | 82ea6da | 2011-12-15 11:03:51 -0800 | [diff] [blame] | 2320 | } |