14f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal/*******************************************************************************
24f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      Copyright (C) 2011 Google Inc.
34f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      Licensed to The Android Open Source Project.
46f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira *
54f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      Licensed under the Apache License, Version 2.0 (the "License");
64f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      you may not use this file except in compliance with the License.
74f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      You may obtain a copy of the License at
86f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira *
94f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *           http://www.apache.org/licenses/LICENSE-2.0
106f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira *
114f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      Unless required by applicable law or agreed to in writing, software
124f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      distributed under the License is distributed on an "AS IS" BASIS,
134f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
144f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      See the License for the specific language governing permissions and
154f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *      limitations under the License.
164f9a4c5ccb1370f583639e763b1c529fe6762271Vikram Aggarwal *******************************************************************************/
176f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
1830e2c24b056542f3b1b438aeb798305d1226d0c8Andy Huangpackage com.android.mail.providers;
196f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
20642731419abb9037a729114d32d6ddd15af0a406Alice Yangimport android.content.ContentProvider;
21642731419abb9037a729114d32d6ddd15af0a406Alice Yangimport android.content.ContentValues;
22d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huangimport android.database.Cursor;
23642731419abb9037a729114d32d6ddd15af0a406Alice Yangimport android.net.Uri;
247f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huangimport android.os.Bundle;
25d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huangimport android.os.Parcelable;
266f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereiraimport android.provider.BaseColumns;
27c97d8acdb45f9632129bd76b5b6f355f9cc57426Paul Westbrookimport android.provider.OpenableColumns;
2882cc5665cb18801022cd60cd52abcd16a50debdcMindy Pereiraimport android.text.TextUtils;
2982cc5665cb18801022cd60cd52abcd16a50debdcMindy Pereira
30deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieuximport com.google.common.annotations.VisibleForTesting;
3142fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantlerimport com.google.common.collect.ImmutableList;
32642731419abb9037a729114d32d6ddd15af0a406Alice Yangimport com.google.common.collect.ImmutableMap;
336f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
34bab9221e13f709bdfae58e17fc182e182948015eAndy Huangimport java.util.Map;
35479505d71969e26b0785d8e0e1b81108731cf827Mark Weiimport java.util.regex.Pattern;
366f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
3782ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrookpublic class UIProvider {
38048b5c892e098d79335a5eb68fa3a1ec1b7b5a85Mindy Pereira    public static final String EMAIL_SEPARATOR = ",";
39326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final long INVALID_CONVERSATION_ID = -1;
40326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final long INVALID_MESSAGE_ID = -1;
41326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira
429ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank    /**
439ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank     * Values for the current state of a Folder/Account; note that it's possible that more than one
449ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank     * sync is in progress
459ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank     */
469ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank    public static final class SyncStatus {
4741b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /**
4841b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * No sync in progress
4941b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         */
50c808fac6076182c77fd5348f5136d325c6e34e14Paul Westbrook        public static final int NO_SYNC = 0;
5141b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /**
5241b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * A user-requested sync/refresh is in progress. This occurs when the user taps on the
5341b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * refresh icon in the action bar.
5441b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         */
55c808fac6076182c77fd5348f5136d325c6e34e14Paul Westbrook        public static final int USER_REFRESH = 1<<0;
5641b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /**
5741b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * A user-requested live query is in progress. This occurs when the user goes past the end
5841b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * of the fetched results in the conversation list.
5941b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         */
6041b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        public static final int LIVE_QUERY = 1<<1;
6141b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /** Please use the constant {@link #LIVE_QUERY} instead. */
6241b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        @Deprecated
63c808fac6076182c77fd5348f5136d325c6e34e14Paul Westbrook        public static final int USER_QUERY = 1<<1;
6441b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /**
6541b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * A background sync is in progress. This happens on <b>no</b> user interaction.
6641b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         */
6741b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        public static final int BACKGROUND_SYNC = 1<<2;
6841b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /**
6941b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * An initial sync is needed for this Account/Folder to be used. This is account-wide, when
7041b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * the user has added an account, and the first sync has not completed successfully.
7141b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         */
7241b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        public static final int INITIAL_SYNC_NEEDED = 1<<3;
7341b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /**
7441b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * Manual sync is required. This is account-wide, when the user has disabled sync on the
7541b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * Gmail account.
7641b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         */
7741b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        public static final int MANUAL_SYNC_REQUIRED = 1<<4;
78dfa1dec0cfdc263c51e971dc3c41b90386a24340Paul Westbrook        /**
79dfa1dec0cfdc263c51e971dc3c41b90386a24340Paul Westbrook         * Account initialization is required.
80dfa1dec0cfdc263c51e971dc3c41b90386a24340Paul Westbrook         */
81dfa1dec0cfdc263c51e971dc3c41b90386a24340Paul Westbrook        public static final int ACCOUNT_INITIALIZATION_REQUIRED = 1<<5;
8270a70c92bca006af84177d025c32deee3aa6da3fMindy Pereira
8370a70c92bca006af84177d025c32deee3aa6da3fMindy Pereira        public static boolean isSyncInProgress(int syncStatus) {
8470a70c92bca006af84177d025c32deee3aa6da3fMindy Pereira            return 0 != (syncStatus & (BACKGROUND_SYNC |
8570a70c92bca006af84177d025c32deee3aa6da3fMindy Pereira                    USER_REFRESH |
86d31f0cf7dc06292527e23853b818aa9c9bc74ba6Vikram Aggarwal                    LIVE_QUERY));
8770a70c92bca006af84177d025c32deee3aa6da3fMindy Pereira        }
889ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank    }
899ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank
909ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank    /**
919ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank     * Values for the result of the last attempted sync of a Folder/Account
929ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank     */
939ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank    public static final class LastSyncResult {
9441b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /** The sync completed successfully */
959ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final int SUCCESS = 0;
9641b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /** The sync wasn't completed due to a connection error */
979ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final int CONNECTION_ERROR = 1;
9841b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /** The sync wasn't completed due to an authentication error */
999ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final int AUTH_ERROR = 2;
10041b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /** The sync wasn't completed due to a security error */
1019ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final int SECURITY_ERROR = 3;
10241b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /** The sync wasn't completed due to a low memory condition */
1039ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final int STORAGE_ERROR = 4;
10441b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal        /** The sync wasn't completed due to an internal error/exception */
1059ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final int INTERNAL_ERROR = 5;
10655d0725ebe4d12c7d1d02f5ee13840c1f200503dJames Lemieux        /** The sync wasn't completed due to an error in the mail server */
10755d0725ebe4d12c7d1d02f5ee13840c1f200503dJames Lemieux        public static final int SERVER_ERROR = 6;
108b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao
109b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao        public static String toString(int result) {
110b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao            switch (result) {
111b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                case SUCCESS: return "success";
112b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                case CONNECTION_ERROR: return "connection_error";
113b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                case AUTH_ERROR: return "auth_error";
114b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                case SECURITY_ERROR: return "security_error";
115b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                case STORAGE_ERROR: return "storage_error";
116b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                case INTERNAL_ERROR: return "internal_error";
117b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                case SERVER_ERROR: return "server_error";
118b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao                default: throw new IllegalArgumentException("Invalid LastSyncResult: " + result);
119b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao            }
120b10d7a552ef4b843b31feb9b781137a0381056b8Jin Cao        }
1219ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank    }
1229ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank
123deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    /**
124deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * Combines the reason for the sync request (user vs. background sync) with the status of the
125deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * request (success vs failure reason) into a single integer value.
126deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     *
127deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * @param syncStatus {@link SyncStatus} value describing the reason for the sync
128deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * @param lastSyncResult {@link LastSyncResult} value describing the result of the sync
129deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * @return a single integer packed with the status and result values
130deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     */
131deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    @VisibleForTesting
132deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    public static int createSyncValue(int syncStatus, int lastSyncResult) {
133deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux        return lastSyncResult | (syncStatus << 4);
134deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    }
135deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux
136deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    /**
137deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * @param lastSyncValue value containing the {@link SyncStatus} and {@link LastSyncResult}
138deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * @return the {@link LastSyncResult} within the <code>lastSyncValue</code>
139deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     */
140deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    public static int getResultFromLastSyncResult(int lastSyncValue) {
141deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux        return lastSyncValue & 0x0f;
142deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    }
143deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux
144deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    /**
145deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * @param lastSyncValue value containing the {@link SyncStatus} and {@link LastSyncResult}
146deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     * @return the {@link SyncStatus} within the <code>lastSyncValue</code>
147deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux     */
148deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    public static int getStatusFromLastSyncResult(int lastSyncValue) {
149deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux        return lastSyncValue >> 4;
150deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux    }
151deee5bee475a678bc2a4efe81c2900b1e5ac54dcJames Lemieux
15282ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook    // The actual content provider should define its own authority
15330e2c24b056542f3b1b438aeb798305d1226d0c8Andy Huang    public static final String AUTHORITY = "com.android.mail.providers";
1546f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
1556f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    public static final String ACCOUNT_LIST_TYPE =
15682ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook            "vnd.android.cursor.dir/vnd.com.android.mail.account";
1576f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    public static final String ACCOUNT_TYPE =
15882ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook            "vnd.android.cursor.item/vnd.com.android.mail.account";
1596f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
1602d82d61d85cd5ed9e9e23c0968b492f11f3ee9bdPaul Westbrook    /**
1612d82d61d85cd5ed9e9e23c0968b492f11f3ee9bdPaul Westbrook     * Query parameter key that can be used to control the behavior of list queries.  The value
1622d82d61d85cd5ed9e9e23c0968b492f11f3ee9bdPaul Westbrook     * must be a serialized {@link ListParams} object.  UIProvider implementations are not
1632d82d61d85cd5ed9e9e23c0968b492f11f3ee9bdPaul Westbrook     * required to respect this query parameter
1642d82d61d85cd5ed9e9e23c0968b492f11f3ee9bdPaul Westbrook     */
1652d82d61d85cd5ed9e9e23c0968b492f11f3ee9bdPaul Westbrook    public static final String LIST_PARAMS_QUERY_PARAMETER = "listParams";
166d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final String LABEL_QUERY_PARAMETER = "label";
167d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final String SEEN_QUERY_PARAMETER = "seen";
1682d82d61d85cd5ed9e9e23c0968b492f11f3ee9bdPaul Westbrook
16941c1694aa317b9e6bda0b9d0db2dae359c3d09a7Scott Kennedy    /**
17041c1694aa317b9e6bda0b9d0db2dae359c3d09a7Scott Kennedy     * Query parameter that can be used to specify a parent for a the returned folder object from a
17141c1694aa317b9e6bda0b9d0db2dae359c3d09a7Scott Kennedy     * query. When set, if a folder is returned that does not have a true parent, it will use this
17241c1694aa317b9e6bda0b9d0db2dae359c3d09a7Scott Kennedy     * uri as its parent uri.
17341c1694aa317b9e6bda0b9d0db2dae359c3d09a7Scott Kennedy     */
17441c1694aa317b9e6bda0b9d0db2dae359c3d09a7Scott Kennedy    public static final String DEFAULT_PARENT_QUERY_PARAMETER = "defaultParent";
17541c1694aa317b9e6bda0b9d0db2dae359c3d09a7Scott Kennedy
176d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final Map<String, Class<?>> ACCOUNTS_COLUMNS_NO_CAPABILITIES =
177bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            new ImmutableMap.Builder<String, Class<?>>()
178d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy            .put(AccountColumns._ID, Integer.class)
179bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.NAME, String.class)
180bb036ff794f022bba2f501e155ef9c412e0e452eTony Mantler            .put(AccountColumns.SENDER_NAME, String.class)
1813e16687b074895bc6cc63a1ed93abf7033586fd2Tony Mantler            .put(AccountColumns.ACCOUNT_MANAGER_NAME, String.class)
182e2c633c9286f7fd571f8a2f507d2c6d002cb8ae1Ray Chen            .put(AccountColumns.ACCOUNT_ID, String.class)
183e5883807fe365a4120a29d21c0e50ae12f30ae5aScott Kennedy            .put(AccountColumns.TYPE, String.class)
184bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.PROVIDER_VERSION, Integer.class)
185bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.URI, String.class)
186bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.FOLDER_LIST_URI, String.class)
187bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.FULL_FOLDER_LIST_URI, String.class)
188009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler            .put(AccountColumns.ALL_FOLDER_LIST_URI, String.class)
189bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SEARCH_URI, String.class)
190bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.ACCOUNT_FROM_ADDRESSES, String.class)
191bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.EXPUNGE_MESSAGE_URI, String.class)
192bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.UNDO_URI, String.class)
193bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SETTINGS_INTENT_URI, String.class)
194bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SYNC_STATUS, Integer.class)
195bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.HELP_INTENT_URI, String.class)
196bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SEND_FEEDBACK_INTENT_URI, String.class)
197bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.REAUTHENTICATION_INTENT_URI, String.class)
198bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.COMPOSE_URI, String.class)
199bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.MIME_TYPE, String.class)
200bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.RECENT_FOLDER_LIST_URI, String.class)
201bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.COLOR, Integer.class)
202bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.DEFAULT_RECENT_FOLDER_LIST_URI, String.class)
203bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.MANUAL_SYNC_URI, String.class)
204bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.VIEW_INTENT_PROXY_URI, String.class)
205bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.ACCOUNT_COOKIE_QUERY_URI, String.class)
206bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.SIGNATURE, String.class)
207bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.AUTO_ADVANCE, Integer.class)
208bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.SNAP_HEADERS, Integer.class)
209bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.REPLY_BEHAVIOR, Integer.class)
210251d6c4300553eb076477590966110a2647b544fScott Kennedy            .put(AccountColumns.SettingsColumns.CONV_LIST_ICON, Integer.class)
211bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.CONFIRM_DELETE, Integer.class)
212bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.CONFIRM_ARCHIVE, Integer.class)
213bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.CONFIRM_SEND, Integer.class)
214bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.DEFAULT_INBOX, String.class)
215bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.DEFAULT_INBOX_NAME, String.class)
216bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.FORCE_REPLY_FROM_DEFAULT, Integer.class)
217bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.MAX_ATTACHMENT_SIZE, Integer.class)
218bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.SWIPE, Integer.class)
21917646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein            .put(AccountColumns.SettingsColumns.IMPORTANCE_MARKERS_ENABLED, Integer.class)
22017646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein            .put(AccountColumns.SettingsColumns.SHOW_CHEVRONS_ENABLED, Integer.class)
221bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.SETUP_INTENT_URI, String.class)
222bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.SettingsColumns.CONVERSATION_VIEW_MODE, Integer.class)
22369a6cdff8afde77ec9bcd75a5651ee212344019eVikram Aggarwal            .put(AccountColumns.SettingsColumns.VEILED_ADDRESS_PATTERN, String.class)
224bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .put(AccountColumns.UPDATE_SETTINGS_URI, String.class)
2253617b41394337774fb2e6fcf9fef1ac9eca00482Alice Yang            .put(AccountColumns.ENABLE_MESSAGE_TRANSFORMS, Integer.class)
226c86b1fbcea43513ea903bb2ca14573423a72d7b5Alice Yang            .put(AccountColumns.SYNC_AUTHORITY, String.class)
22759e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler            .put(AccountColumns.QUICK_RESPONSE_URI, String.class)
228e01cc8d461dd0cc3dae8b2f03235c32a0b7f865cTony Mantler            .put(AccountColumns.SETTINGS_FRAGMENT_CLASS, String.class)
229dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy            .put(AccountColumns.SettingsColumns.MOVE_TO_INBOX, String.class)
230f323c046034b4658a80438575d8e9f01d92e57e6Alice Yang            .put(AccountColumns.SettingsColumns.SHOW_IMAGES, Integer.class)
2319dc8a334c06a8b58daf6fe3033726edceccc74b4Milos Stankovic            .put(AccountColumns.SettingsColumns.WELCOME_TOUR_SHOWN_VERSION, Integer.class)
232469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon            .put(AccountColumns.SECURITY_HOLD, Integer.class)
233469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon            .put(AccountColumns.ACCOUNT_SECURITY_URI, String.class)
234bab9221e13f709bdfae58e17fc182e182948015eAndy Huang            .build();
235bab9221e13f709bdfae58e17fc182e182948015eAndy Huang
236d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final Map<String, Class<?>> ACCOUNTS_COLUMNS =
237d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy            new ImmutableMap.Builder<String, Class<?>>()
238d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy            .putAll(ACCOUNTS_COLUMNS_NO_CAPABILITIES)
239d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy            .put(AccountColumns.CAPABILITIES, Integer.class)
240d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy            .build();
241d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy
242d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    // pull out the keyset from above to form the projection
243d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final String[] ACCOUNTS_PROJECTION =
244d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy            ACCOUNTS_COLUMNS.keySet().toArray(new String[ACCOUNTS_COLUMNS.size()]);
245d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy
246d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final
247d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy            String[] ACCOUNTS_PROJECTION_NO_CAPABILITIES = ACCOUNTS_COLUMNS_NO_CAPABILITIES.keySet()
248d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy                    .toArray(new String[ACCOUNTS_COLUMNS_NO_CAPABILITIES.size()]);
2490d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy
2506f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    public static final class AccountCapabilities {
251859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
252859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether folders can be synchronized back to the server.
253859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
25482ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        public static final int SYNCABLE_FOLDERS = 0x0001;
255859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
256859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server allows reporting spam back.
257859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
25882ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        public static final int REPORT_SPAM = 0x0002;
259859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
26077eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook         * Whether the server allows reporting phishing back.
26177eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook         */
26277eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int REPORT_PHISHING = 0x0004;
26377eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        /**
264859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server supports a concept of Archive: removing mail from the Inbox but
265859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * keeping it around.
266859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
26777eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int ARCHIVE = 0x0008;
268859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
269859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server will stop notifying on updates to this thread? This requires
270859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * THREADED_CONVERSATIONS to be true, otherwise it should be ignored.
271859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
27277eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int MUTE = 0x0010;
273859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
274859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server supports searching over all messages. This requires SYNCABLE_FOLDERS
275859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * to be true, otherwise it should be ignored.
276859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
27777eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int SERVER_SEARCH = 0x0020;
278859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
279859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server supports constraining search to a single folder. Requires
280859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * SYNCABLE_FOLDERS, otherwise it should be ignored.
281859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
28277eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int FOLDER_SERVER_SEARCH = 0x0040;
283859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
284859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server sends us sanitized HTML (guaranteed to not contain malicious HTML).
285859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
286ccf9a34bcdcfdb884799ea3f3ecbd425970f26fcJames Lemieux        public static final int SERVER_SANITIZED_HTML = 0x0080;
287859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
288859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server allows synchronization of draft messages. This does NOT require
289859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * SYNCABLE_FOLDERS to be set.
290859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
29177eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int DRAFT_SYNCHRONIZATION = 0x0100;
292859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
293859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Does the server allow the user to compose mails (and reply) using addresses other than
294859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * their account name? For instance, GMail allows users to set FROM addresses that are
295859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * different from account@gmail.com address. For instance, user@gmail.com could have another
296859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * FROM: address like user@android.com. If the user has enabled multiple FROM address, he
297859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * can compose (and reply) using either address.
298859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
29977eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int MULTIPLE_FROM_ADDRESSES = 0x0200;
300859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
301859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server allows the original message to be included in the reply by setting a
302859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * flag on the reply. If we can avoid including the entire previous message, we save on
303859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * bandwidth (replies are shorter).
304859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
30577eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int SMART_REPLY = 0x0400;
306859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
307859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Does this account support searching locally, on the device? This requires the backend
308859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * storage to support a mechanism for searching.
309859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
31077eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int LOCAL_SEARCH = 0x0800;
311859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
312859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server supports a notion of threaded conversations: where replies to messages
313859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * are tagged to keep conversations grouped. This could be full threading (each message
314859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * lists its parent) or conversation-level threading (each message lists one conversation
315859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * which it belongs to)
316859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
31777eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int THREADED_CONVERSATIONS = 0x1000;
318859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal        /**
319859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         * Whether the server supports allowing a conversation to be in multiple folders. (Or allows
32030fd47bf1947da5ad813cb957b6cbe569dce563aMindy Pereira         * multiple folders on a single conversation)
321859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal         */
32277eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int MULTIPLE_FOLDERS_PER_CONV = 0x2000;
323343ffebe391df40713fc4a41ae97d9e08d0b9b4bMindy Pereira        /**
324343ffebe391df40713fc4a41ae97d9e08d0b9b4bMindy Pereira         * Whether the provider supports undoing operations. If it doesn't, never show the undo bar.
325343ffebe391df40713fc4a41ae97d9e08d0b9b4bMindy Pereira         */
32677eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int UNDO = 0x4000;
32794e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook        /**
32894e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook         * Whether the account provides help content.
32994e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook         */
33077eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int HELP_CONTENT = 0x8000;
3317f0a962513503cb01aec093b14c1b48dfae08f12Mindy Pereira        /**
332517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook         * Whether the account provides a way to send feedback content.
333517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook         */
33477eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int SEND_FEEDBACK = 0x10000;
335517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook        /**
3367f0a962513503cb01aec093b14c1b48dfae08f12Mindy Pereira         * Whether the account provides a mechanism for marking conversations as important.
3377f0a962513503cb01aec093b14c1b48dfae08f12Mindy Pereira         */
33877eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int MARK_IMPORTANT = 0x20000;
33951144944c2088299ebc2584cc09c61c23eb18659Marc Blank        /**
34051144944c2088299ebc2584cc09c61c23eb18659Marc Blank         * Whether initial conversation queries should use a limit parameter
34151144944c2088299ebc2584cc09c61c23eb18659Marc Blank         */
34277eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final int INITIAL_CONVERSATION_LIMIT = 0x40000;
343d370792663454356c8c7fc12bee9731f3e990183Marc Blank        /**
3448b85a9b88244bd910d63a7a0f594f3792b157aa0Tony Mantler         * Whether the account is not a real account, i.e. Combined View
345d370792663454356c8c7fc12bee9731f3e990183Marc Blank         */
3468b85a9b88244bd910d63a7a0f594f3792b157aa0Tony Mantler        public static final int VIRTUAL_ACCOUNT = 0x80000;
347ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook        /**
348ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook         * Whether the account supports discarding drafts from a conversation.  This should be
349ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook         * removed when all providers support this capability
350ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook         */
351ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook        public static final int DISCARD_CONVERSATION_DRAFTS = 0x100000;
3527ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy        /**
3537ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy         * Whether the account supports emptying the trash folder
3547ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy         */
3557ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy        public static final int EMPTY_TRASH = 0x200000;
3567ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy        /**
3577ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy         * Whether the account supports emptying the spam folder
3587ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy         */
3597ee089ea2ef96e31504e88637b5f3b0969b3c7c1Scott Kennedy        public static final int EMPTY_SPAM = 0x400000;
3600e8dc84326ad3e6d146a203538665f98dd98f688Scott Kennedy        /**
3610e8dc84326ad3e6d146a203538665f98dd98f688Scott Kennedy         * Whether the account supports nested folders
3620e8dc84326ad3e6d146a203538665f98dd98f688Scott Kennedy         */
3630e8dc84326ad3e6d146a203538665f98dd98f688Scott Kennedy        public static final int NESTED_FOLDERS = 0x800000;
364ccf9a34bcdcfdb884799ea3f3ecbd425970f26fcJames Lemieux        /**
365ccf9a34bcdcfdb884799ea3f3ecbd425970f26fcJames Lemieux         * Whether the client is permitted to sanitize HTML for this account.
366ccf9a34bcdcfdb884799ea3f3ecbd425970f26fcJames Lemieux         */
367ccf9a34bcdcfdb884799ea3f3ecbd425970f26fcJames Lemieux        public static final int CLIENT_SANITIZED_HTML = 0x1000000;
3686f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    }
3696f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
370d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final class AccountColumns implements BaseColumns {
37182ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
37282ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         * This string column contains the human visible name for the account.
37382ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         */
3746f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String NAME = "name";
37582ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
37682ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
377bb036ff794f022bba2f501e155ef9c412e0e452eTony Mantler         * This string column contains the real name associated with the account, e.g. "John Doe"
378bb036ff794f022bba2f501e155ef9c412e0e452eTony Mantler         */
379bb036ff794f022bba2f501e155ef9c412e0e452eTony Mantler        public static final String SENDER_NAME = "senderName";
380bb036ff794f022bba2f501e155ef9c412e0e452eTony Mantler
381bb036ff794f022bba2f501e155ef9c412e0e452eTony Mantler        /**
3823e16687b074895bc6cc63a1ed93abf7033586fd2Tony Mantler         * This string column contains the account manager name of this account.
3833e16687b074895bc6cc63a1ed93abf7033586fd2Tony Mantler         */
3843e16687b074895bc6cc63a1ed93abf7033586fd2Tony Mantler        public static final String ACCOUNT_MANAGER_NAME = "accountManagerName";
3853e16687b074895bc6cc63a1ed93abf7033586fd2Tony Mantler
3863e16687b074895bc6cc63a1ed93abf7033586fd2Tony Mantler        /**
387e2c633c9286f7fd571f8a2f507d2c6d002cb8ae1Ray Chen         * This string column contains the account id of this account.
388e2c633c9286f7fd571f8a2f507d2c6d002cb8ae1Ray Chen         */
389e2c633c9286f7fd571f8a2f507d2c6d002cb8ae1Ray Chen        public static final String ACCOUNT_ID = "accountId";
390e2c633c9286f7fd571f8a2f507d2c6d002cb8ae1Ray Chen
391e2c633c9286f7fd571f8a2f507d2c6d002cb8ae1Ray Chen        /**
3926dde178687e85aaab9b3f8e9c124c3ab99b77d5aVikram Aggarwal         * This integer contains the type of the account: Google versus non google. This is not
3936dde178687e85aaab9b3f8e9c124c3ab99b77d5aVikram Aggarwal         * returned by the UIProvider, rather this is a notion in the system.
3946dde178687e85aaab9b3f8e9c124c3ab99b77d5aVikram Aggarwal         */
3956dde178687e85aaab9b3f8e9c124c3ab99b77d5aVikram Aggarwal        public static final String TYPE = "type";
3966dde178687e85aaab9b3f8e9c124c3ab99b77d5aVikram Aggarwal
3976dde178687e85aaab9b3f8e9c124c3ab99b77d5aVikram Aggarwal        /**
39882ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         * This integer column returns the version of the UI provider schema from which this
39982ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         * account provider will return results.
40082ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         */
4016f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String PROVIDER_VERSION = "providerVersion";
40282ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
40382ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
40482ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         * This string column contains the uri to directly access the information for this account.
40582ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         */
4066349a043bce28ec999d72635222ae0eb576eb9cdMindy Pereira        public static final String URI = "accountUri";
40782ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
40882ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
409e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * This integer column contains a bit field of the possible capabilities that this account
41082ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         * supports.
41182ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         */
4126f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String CAPABILITIES = "capabilities";
41382ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
41482ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
415750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         * This string column contains the content provider uri to return the
416750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         * list of top level folders for this account.
41782ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         */
4186f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String FOLDER_LIST_URI = "folderListUri";
41982ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
42082ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
42131d7967c857d7486f27329135dffb3a2977b54e2Mindy Pereira         * This string column contains the content provider uri to return the
422009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler         * list of all real folders for this account.
42331d7967c857d7486f27329135dffb3a2977b54e2Mindy Pereira         */
42431d7967c857d7486f27329135dffb3a2977b54e2Mindy Pereira        public static final String FULL_FOLDER_LIST_URI = "fullFolderListUri";
42531d7967c857d7486f27329135dffb3a2977b54e2Mindy Pereira
42631d7967c857d7486f27329135dffb3a2977b54e2Mindy Pereira        /**
427009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler         * This string column contains the content provider uri to return the
428009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler         * list of all real and synthetic folders for this account.
429009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler         */
430009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler        public static final String ALL_FOLDER_LIST_URI = "allFolderListUri";
431009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler
432009f1b55b555638fd7276f8b996243a5d4ba7681Tony Mantler        /**
43382ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         * This string column contains the content provider uri that can be queried for search
43482ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         * results.
4358130e6f851c596985836084c7a21899d908c0c54Paul Westbrook         * The supported query parameters are limited to those listed
436d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         * in {@link SearchQueryParameters}
4371475a7a8110ba0bc452be33e0162aa61f8dbada6Paul Westbrook         * The cursor returned from this query is expected have one row, where the columnm are a
438d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         * subset of the columns specified in {@link FolderColumns}
43982ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         */
4406f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String SEARCH_URI = "searchUri";
44182ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
44282ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
44392551d057965689f1952faeb06763f0762bc717fMindy Pereira         * This string column contains a json array of json objects representing
44492551d057965689f1952faeb06763f0762bc717fMindy Pereira         * custom from addresses for this account or null if there are none.
44582ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook         */
44692551d057965689f1952faeb06763f0762bc717fMindy Pereira        public static final String ACCOUNT_FROM_ADDRESSES = "accountFromAddresses";
44782ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
44882ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        /**
44982cc5665cb18801022cd60cd52abcd16a50debdcMindy Pereira         * This string column contains the content provider uri that can be used
45082cc5665cb18801022cd60cd52abcd16a50debdcMindy Pereira         * to expunge a message from this account. NOTE: This might be better to
45182cc5665cb18801022cd60cd52abcd16a50debdcMindy Pereira         * be an update operation on the messageUri.
45241b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * When {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[])}
45341b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * is called with this uri, the {@link ContentValues} object is expected to have
45441b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * {@link BaseColumns#_ID} specified with the local message id of the message.
45582cc5665cb18801022cd60cd52abcd16a50debdcMindy Pereira         */
45682cc5665cb18801022cd60cd52abcd16a50debdcMindy Pereira        public static final String EXPUNGE_MESSAGE_URI = "expungeMessageUri";
45796b5c357860f46a7bd5f867774a53d5cc5069defMindy Pereira
45896b5c357860f46a7bd5f867774a53d5cc5069defMindy Pereira        /**
45996b5c357860f46a7bd5f867774a53d5cc5069defMindy Pereira         * This string column contains the content provider uri that can be used
46096b5c357860f46a7bd5f867774a53d5cc5069defMindy Pereira         * to undo the last committed action.
46196b5c357860f46a7bd5f867774a53d5cc5069defMindy Pereira         */
4629600dac67c5b3844b3a43a229bf3c309d84f978cMindy Pereira        public static final String UNDO_URI = "undoUri";
4632861b6a649090ce1401b4bb04dd87df5bb26472bPaul Westbrook
4642861b6a649090ce1401b4bb04dd87df5bb26472bPaul Westbrook        /**
4659912eee82731d0cbf2c6cf35e62c8388c2a9ee79Paul Westbrook         * Uri for EDIT intent that will cause the settings screens for this account type to be
4662861b6a649090ce1401b4bb04dd87df5bb26472bPaul Westbrook         * shown.
467e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         * Optionally, extra values from {@link EditSettingsExtras} can be used to indicate
468e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         * which settings the user wants to edit.
4692861b6a649090ce1401b4bb04dd87df5bb26472bPaul Westbrook         * TODO: When we want to support a heterogeneous set of account types, this value may need
4702861b6a649090ce1401b4bb04dd87df5bb26472bPaul Westbrook         * to be moved to a global content provider.
4712861b6a649090ce1401b4bb04dd87df5bb26472bPaul Westbrook         */
472b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String SETTINGS_INTENT_URI = "accountSettingsIntentUri";
4739ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank
4749ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        /**
47594e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook         * Uri for VIEW intent that will cause the help screens for this account type to be
47694e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook         * shown.
47794e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook         * TODO: When we want to support a heterogeneous set of account types, this value may need
47894e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook         * to be moved to a global content provider.
47994e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook         */
480b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String HELP_INTENT_URI = "helpIntentUri";
48194e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook
48294e440d7fb9bb54ba4b22e348a2e22f3cf8e0167Paul Westbrook        /**
483517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook         * Uri for VIEW intent that will cause the send feedback for this account type to be
484517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook         * shown.
485517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook         * TODO: When we want to support a heterogeneous set of account types, this value may need
486517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook         * to be moved to a global content provider.
487517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook         */
488b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String SEND_FEEDBACK_INTENT_URI = "sendFeedbackIntentUri";
489517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook
490517743ef4e3e4ac103a3c096b9e3c894da7ed87aPaul Westbrook        /**
491122f7c2cf45cd5f07462a7b0a553f82828a8b1a2Paul Westbrook         * Uri for VIEW intent that will cause the user to be prompted for authentication for
492122f7c2cf45cd5f07462a7b0a553f82828a8b1a2Paul Westbrook         * this account.  startActivityForResult() will be called with this intent. Activities that
49341b9e8f7bea47bbcae71b9ae81c3608a00a90e70Vikram Aggarwal         * handle this intent are expected to return {@link android.app.Activity#RESULT_OK} if the
494122f7c2cf45cd5f07462a7b0a553f82828a8b1a2Paul Westbrook         * user successfully authenticated.
495122f7c2cf45cd5f07462a7b0a553f82828a8b1a2Paul Westbrook         */
496b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String REAUTHENTICATION_INTENT_URI = "reauthenticationUri";
497122f7c2cf45cd5f07462a7b0a553f82828a8b1a2Paul Westbrook
498122f7c2cf45cd5f07462a7b0a553f82828a8b1a2Paul Westbrook        /**
4999ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         * This int column contains the current sync status of the account (the logical AND of the
5009ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         * sync status of folders in this account)
5019ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         */
5029ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final String SYNC_STATUS = "syncStatus";
50323755e2109c3f97e3b51857e4a81355b1a3995a7Mindy Pereira        /**
50423755e2109c3f97e3b51857e4a81355b1a3995a7Mindy Pereira         * Uri for VIEW intent that will cause the compose screens for this type
50523755e2109c3f97e3b51857e4a81355b1a3995a7Mindy Pereira         * of account to be shown.
50623755e2109c3f97e3b51857e4a81355b1a3995a7Mindy Pereira         */
50723755e2109c3f97e3b51857e4a81355b1a3995a7Mindy Pereira        public static final String COMPOSE_URI = "composeUri";
508898cd38018ff4331e79262451f464efa9dc5d43eMindy Pereira        /**
509898cd38018ff4331e79262451f464efa9dc5d43eMindy Pereira         * Mime-type defining this account.
510898cd38018ff4331e79262451f464efa9dc5d43eMindy Pereira         */
511898cd38018ff4331e79262451f464efa9dc5d43eMindy Pereira        public static final String MIME_TYPE = "mimeType";
51227e85f244604c8de53b76b135e0dd6f2bf3cad96Vikram Aggarwal        /**
51327e85f244604c8de53b76b135e0dd6f2bf3cad96Vikram Aggarwal         * URI for location of recent folders viewed on this account.
51427e85f244604c8de53b76b135e0dd6f2bf3cad96Vikram Aggarwal         */
51527e85f244604c8de53b76b135e0dd6f2bf3cad96Vikram Aggarwal        public static final String RECENT_FOLDER_LIST_URI = "recentFolderListUri";
516b287833c2645e2502792821e54d7226cfad59955Marc Blank        /**
51727d89ada3e8d1b17357a7064e1f47f3c15686412Vikram Aggarwal         * URI for default recent folders for this account, if any.
51827d89ada3e8d1b17357a7064e1f47f3c15686412Vikram Aggarwal         */
51927d89ada3e8d1b17357a7064e1f47f3c15686412Vikram Aggarwal        public static final String DEFAULT_RECENT_FOLDER_LIST_URI = "defaultRecentFolderListUri";
52027d89ada3e8d1b17357a7064e1f47f3c15686412Vikram Aggarwal        /**
521bab9221e13f709bdfae58e17fc182e182948015eAndy Huang         * Color (integer) used for this account (for Email/Combined view)
522b287833c2645e2502792821e54d7226cfad59955Marc Blank         */
523b287833c2645e2502792821e54d7226cfad59955Marc Blank        public static final String COLOR = "color";
524b378d64bab3c7517794ad7e2aee1d06c074e99eeMindy Pereira        /**
525b378d64bab3c7517794ad7e2aee1d06c074e99eeMindy Pereira         * URI for forcing a manual sync of this account.
526b378d64bab3c7517794ad7e2aee1d06c074e99eeMindy Pereira         */
527b378d64bab3c7517794ad7e2aee1d06c074e99eeMindy Pereira        public static final String MANUAL_SYNC_URI = "manualSyncUri";
5289982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        /**
5299982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         * Optional URI of this account for proxying view intents.
5309982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         */
5319982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        public static final String VIEW_INTENT_PROXY_URI = "viewProxyUri";
532b8361c9f8938b74977316319885998aae09aab77Paul Westbrook        /**
533b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         * Optional URI for querying for the cookie needed for accessing inline content.  The cookie
534b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         * specified here will be set on the uri specified in the
535b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         * {@link ConversationColumns#CONVERSATION_BASE_URI} column. The cursor returned from this
536b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         * query is expected have one row, where the columns are specified in
537b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         * {@link AccountCookieColumns}
538b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         */
539b8361c9f8938b74977316319885998aae09aab77Paul Westbrook        public static final String ACCOUNT_COOKIE_QUERY_URI = "accountCookieUri";
5400d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy        /**
5410d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         * URI to be used with an update() ContentResolver call with a {@link ContentValues} object
5420d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         * where the keys are from the {@link AccountColumns.SettingsColumns}, and the values are
5430d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         * the new values.
5440d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         */
5450d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy        public static final String UPDATE_SETTINGS_URI = "updateSettingsUri";
5463617b41394337774fb2e6fcf9fef1ac9eca00482Alice Yang        /**
5473617b41394337774fb2e6fcf9fef1ac9eca00482Alice Yang         * Whether message transforms (HTML DOM manipulation) should be enabled.
5483617b41394337774fb2e6fcf9fef1ac9eca00482Alice Yang         */
5493617b41394337774fb2e6fcf9fef1ac9eca00482Alice Yang        public static final String ENABLE_MESSAGE_TRANSFORMS = "enableMessageTransforms";
550c86b1fbcea43513ea903bb2ca14573423a72d7b5Alice Yang        /**
551c86b1fbcea43513ea903bb2ca14573423a72d7b5Alice Yang         * Sync authority to use.
552c86b1fbcea43513ea903bb2ca14573423a72d7b5Alice Yang         */
553c86b1fbcea43513ea903bb2ca14573423a72d7b5Alice Yang        public static final String SYNC_AUTHORITY = "syncAuthority";
55459e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        /**
55559e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler         * URI for querying this account's quick responses
55659e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler         */
55759e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        public static final String QUICK_RESPONSE_URI = "quickResponseUri";
558e01cc8d461dd0cc3dae8b2f03235c32a0b7f865cTony Mantler        /**
559e01cc8d461dd0cc3dae8b2f03235c32a0b7f865cTony Mantler         * Fragment class name for account settings
560e01cc8d461dd0cc3dae8b2f03235c32a0b7f865cTony Mantler         */
561e01cc8d461dd0cc3dae8b2f03235c32a0b7f865cTony Mantler        public static final String SETTINGS_FRAGMENT_CLASS = "settingsFragmentClass";
562469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon        /**
563469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon         * Whether this account is on a security hold
564469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon         */
565469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon        public static final String SECURITY_HOLD = "securityHold";
566469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon        /**
567469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon         * Uri to access the account security activity.
568469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon         */
569469817c69011b108f953ada64bf10eaf7dd31341Martin Hibdon        public static final String ACCOUNT_SECURITY_URI = "accountSecurityUri";
570b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
571b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook        public static final class SettingsColumns {
572b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
573b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * String column containing the contents of the signature for this account.  If no
574b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * signature has been specified, the value will be null.
575b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
576b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String SIGNATURE = "signature";
577b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
578b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
579b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * Integer column containing the user's specified auto-advance policy.  This value will
580b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * be one of the values in {@link UIProvider.AutoAdvance}
581b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
582b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String AUTO_ADVANCE = "auto_advance";
583b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
584b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
585b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * Integer column contaning the user's specified snap header preference.  This value
586b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * will be one of the values in {@link UIProvider.SnapHeaderValue}
587b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
588b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String SNAP_HEADERS = "snap_headers";
589b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
590b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
591b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * Integer column containing the user's specified default reply behavior.  This value
592b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * will be one of the values in {@link UIProvider.DefaultReplyBehavior}
593b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
594b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String REPLY_BEHAVIOR = "reply_behavior";
595b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
596b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
5974a53f5b1b05d99ea6e8c5338dcc0dac039a3e1cdAlice Yang             * Integer column containing the user's preference for whether to show sender images
5984a53f5b1b05d99ea6e8c5338dcc0dac039a3e1cdAlice Yang             * or not in the conversation list view.  This value will be one of the values in
5994a53f5b1b05d99ea6e8c5338dcc0dac039a3e1cdAlice Yang             * {@link UIProvider.ConversationListIcon}.
600b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
601642731419abb9037a729114d32d6ddd15af0a406Alice Yang            public static final String CONV_LIST_ICON = "conversation_list_icon";
602b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
603b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
604b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * Integer column containing the user's specified confirm delete preference value.
605b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * A non zero value indicates that the user has indicated that a confirmation should
606b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * be shown when a delete action is performed.
607b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
608b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String CONFIRM_DELETE = "confirm_delete";
609b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
610b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
611b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * Integer column containing the user's specified confirm archive preference value.
612b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * A non zero value indicates that the user has indicated that a confirmation should
613b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * be shown when an archive action is performed.
614b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
615b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String CONFIRM_ARCHIVE = "confirm_archive";
616b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook
617b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
618b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * Integer column containing the user's specified confirm send preference value.
619b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * A non zero value indicates that the user has indicated that a confirmation should
620b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * be shown when a send action is performed.
621b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
622b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String CONFIRM_SEND = "confirm_send";
623b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
624571de2212f311cc4a514ffa74e7585a2df1fb907Mindy Pereira             * String containing the URI for the default inbox for this account.
625b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
626b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            public static final String DEFAULT_INBOX = "default_inbox";
627b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook            /**
6285e63e8aae365dc210a0647b7e1c87f76bf652c80Vikram Aggarwal             * String containing the name of the default Inbox for this account
6295e63e8aae365dc210a0647b7e1c87f76bf652c80Vikram Aggarwal             */
6305e63e8aae365dc210a0647b7e1c87f76bf652c80Vikram Aggarwal            public static final String DEFAULT_INBOX_NAME = "default_inbox_name";
6315e63e8aae365dc210a0647b7e1c87f76bf652c80Vikram Aggarwal            /**
632b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * Integer column containing a non zero value if replies should always be sent from
633b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             * a default address instead of a recipient.
634b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook             */
6353cd4f40dab2c0810cb5ecd77256abf022863b2b5Mindy Pereira            public static final String FORCE_REPLY_FROM_DEFAULT = "force_reply_from_default";
6363cd4f40dab2c0810cb5ecd77256abf022863b2b5Mindy Pereira            /**
6373cd4f40dab2c0810cb5ecd77256abf022863b2b5Mindy Pereira             * Integer column containing the max attachment size in kb.
6383cd4f40dab2c0810cb5ecd77256abf022863b2b5Mindy Pereira             */
6393cd4f40dab2c0810cb5ecd77256abf022863b2b5Mindy Pereira            public static final String MAX_ATTACHMENT_SIZE = "max_attachment_size";
64071a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira            /**
64171a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira             * Integer column containing a value matching one of the constants from {@link Swipe}
64271a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira             */
64371a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira            public static final String SWIPE = "swipe";
644707f24c693f116901660ce4b07598b474e681319Vikram Aggarwal            /**
64517646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein             * Integer column containing whether importance markers are enabled.
646707f24c693f116901660ce4b07598b474e681319Vikram Aggarwal             */
64717646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein            public static final String IMPORTANCE_MARKERS_ENABLED = "importance_markers_enabled";
64817646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein            /**
64917646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein             * Integer column containing whether chevrons should be shown.
65017646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein             * Chevrons are personal level indicators:
65117646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein             * an arrow ( › ) by messages sent to my address (not a mailing list),
65217646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein             * and a double arrow ( » ) by messages sent only to me.
65317646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein             */
65417646055214b9ab3abc2553379bf046ca3e53fb2Andrew Sapperstein            public static final String SHOW_CHEVRONS_ENABLED = "show_chevrons_enabled";
65557899081749fac79c25362cc591705f8bd1c1f58Marc Blank            /**
65657899081749fac79c25362cc591705f8bd1c1f58Marc Blank             * Uri for EDIT intent that will cause account-specific setup UI to be shown. If not
65757899081749fac79c25362cc591705f8bd1c1f58Marc Blank             * null, this intent should be used when an account is "entered" (i.e. viewing a folder
65857899081749fac79c25362cc591705f8bd1c1f58Marc Blank             * in the account, etc.)
65957899081749fac79c25362cc591705f8bd1c1f58Marc Blank             */
66057899081749fac79c25362cc591705f8bd1c1f58Marc Blank            public static final String SETUP_INTENT_URI = "setup_intent_uri";
661fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook            /**
66269a6cdff8afde77ec9bcd75a5651ee212344019eVikram Aggarwal             * The regex that defines a veiled address, something that must be hidden from user
66369a6cdff8afde77ec9bcd75a5651ee212344019eVikram Aggarwal             * view because it is temporary, long and clumsy.
66469a6cdff8afde77ec9bcd75a5651ee212344019eVikram Aggarwal             */
6656c3875a89770e2cb67fa3ddb64cd82524b3e67d4Vikram Aggarwal            public static final String VEILED_ADDRESS_PATTERN = "veiled_address_pattern";
66669a6cdff8afde77ec9bcd75a5651ee212344019eVikram Aggarwal            /**
667fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook             * Integer column containing the Conversation view mode.  This value will match one of
668fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook             * constants from  {@link ConversationViewMode}
669fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook             */
670fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook            public static final String CONVERSATION_VIEW_MODE = "conversation_view_mode";
671dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy            /**
672dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy             * String containing the URI for the inbox conversations should be moved to for this
673dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy             * account.
674dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy             */
675dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy            public static final String MOVE_TO_INBOX = "move_to_inbox";
676f323c046034b4658a80438575d8e9f01d92e57e6Alice Yang            /**
677f323c046034b4658a80438575d8e9f01d92e57e6Alice Yang             * Show images in conversation view.
678f323c046034b4658a80438575d8e9f01d92e57e6Alice Yang             */
679f323c046034b4658a80438575d8e9f01d92e57e6Alice Yang            public static final String SHOW_IMAGES = "show_images";
680ede2e52e725abc625ae963f979639ff8ecc40cf5Greg Bullock
681ede2e52e725abc625ae963f979639ff8ecc40cf5Greg Bullock            /**
6829dc8a334c06a8b58daf6fe3033726edceccc74b4Milos Stankovic             * The version of the welcome tour that user saw on android device.
683ede2e52e725abc625ae963f979639ff8ecc40cf5Greg Bullock             */
6849dc8a334c06a8b58daf6fe3033726edceccc74b4Milos Stankovic            public static final String WELCOME_TOUR_SHOWN_VERSION = "welcome_tour_shown_version";
685b1f573c59ec20f9149443e1e0cc8b64ff3a07feaPaul Westbrook        }
6863a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira    }
6873a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira
68859e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler    public static final String[] QUICK_RESPONSE_PROJECTION = {
68959e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        BaseColumns._ID,
69059e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        QuickResponseColumns.TEXT,
69159e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        QuickResponseColumns.URI
69259e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler    };
69359e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler
69459e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler    public static final class QuickResponseColumns {
69559e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        /**
69659e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler         * Text of the Quick Response
69759e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler         */
69859e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        public static final String TEXT = "quickResponse";
69959e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        /**
70059e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler         * URI to access this row directly
70159e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler         */
70259e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler        public static final String URI = "uri";
70359e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler    }
70459e69095bd558a1e6ae890ce79b7b848331d0cc6Tony Mantler
705b8361c9f8938b74977316319885998aae09aab77Paul Westbrook    public static final String[] ACCOUNT_COOKIE_PROJECTION = {
706b8361c9f8938b74977316319885998aae09aab77Paul Westbrook        AccountCookieColumns.COOKIE
707b8361c9f8938b74977316319885998aae09aab77Paul Westbrook    };
708b8361c9f8938b74977316319885998aae09aab77Paul Westbrook
709b8361c9f8938b74977316319885998aae09aab77Paul Westbrook    public static final class AccountCookieColumns {
710b8361c9f8938b74977316319885998aae09aab77Paul Westbrook        /**
711b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         * String column containing the cookie string for this account.
712b8361c9f8938b74977316319885998aae09aab77Paul Westbrook         */
713b8361c9f8938b74977316319885998aae09aab77Paul Westbrook        public static final String COOKIE = "cookie";
714b8361c9f8938b74977316319885998aae09aab77Paul Westbrook    }
715b8361c9f8938b74977316319885998aae09aab77Paul Westbrook
7168130e6f851c596985836084c7a21899d908c0c54Paul Westbrook    public static final class SearchQueryParameters {
7178130e6f851c596985836084c7a21899d908c0c54Paul Westbrook        /**
7188130e6f851c596985836084c7a21899d908c0c54Paul Westbrook         * Parameter used to specify the search query.
7198130e6f851c596985836084c7a21899d908c0c54Paul Westbrook         */
7208130e6f851c596985836084c7a21899d908c0c54Paul Westbrook        public static final String QUERY = "query";
7218130e6f851c596985836084c7a21899d908c0c54Paul Westbrook
7221a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        /*
7231a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * This parameter is set by ACTION_SEARCH to differentiate one ACTION_SEARCH from another.
7241a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * This is necessary because the Uri we construct for each query is only based on the
7251a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * search query string. However, subsequent searches with the same string will confuse
7261a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * the underlying provider into thinking that it's still the same "session", thus it will
7271a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * keep the data it had before. This is a problem when we do search on some keyword, then
7281a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * without navigating away we do the same search again (expecting to see new results there
7291a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * and outdated results gone). By keying the Uri on both search query and a unique id,
7301a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * we ensure that old data gets properly destroyed.
7311a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        * @see UnifiedGmail, MailEngine#getConversationCursorForQuery.
7321a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        */
7331a864cce6321f46031d6cd43e205278d0f219f92Jin Cao        public static final String QUERY_IDENTIFER = "query_identifier";
7341a864cce6321f46031d6cd43e205278d0f219f92Jin Cao
7358130e6f851c596985836084c7a21899d908c0c54Paul Westbrook        private SearchQueryParameters() {}
7368130e6f851c596985836084c7a21899d908c0c54Paul Westbrook    }
7378130e6f851c596985836084c7a21899d908c0c54Paul Westbrook
73851144944c2088299ebc2584cc09c61c23eb18659Marc Blank    public static final class ConversationListQueryParameters {
73951144944c2088299ebc2584cc09c61c23eb18659Marc Blank        public static final String DEFAULT_LIMIT = "50";
74051144944c2088299ebc2584cc09c61c23eb18659Marc Blank        /**
74151144944c2088299ebc2584cc09c61c23eb18659Marc Blank         * Parameter used to limit the number of rows returned by a conversation list query
74251144944c2088299ebc2584cc09c61c23eb18659Marc Blank         */
74351144944c2088299ebc2584cc09c61c23eb18659Marc Blank        public static final String LIMIT = "limit";
74451144944c2088299ebc2584cc09c61c23eb18659Marc Blank
7455f2876a4638bbc7fed2d971c777c8e2bef1cdcf2Paul Westbrook        /**
7465f2876a4638bbc7fed2d971c777c8e2bef1cdcf2Paul Westbrook         * Parameter used to control whether the this query a remote server.
7475f2876a4638bbc7fed2d971c777c8e2bef1cdcf2Paul Westbrook         */
7485f2876a4638bbc7fed2d971c777c8e2bef1cdcf2Paul Westbrook        public static final String USE_NETWORK = "use_network";
7495f2876a4638bbc7fed2d971c777c8e2bef1cdcf2Paul Westbrook
7504880b5dea0335c887e6e6e5535365c3a313b96b7Paul Westbrook        /**
7514880b5dea0335c887e6e6e5535365c3a313b96b7Paul Westbrook         * Parameter used to allow the caller to indicate desire to receive all notifications.
7524880b5dea0335c887e6e6e5535365c3a313b96b7Paul Westbrook         * (Including ones for user initiated actions)
7534880b5dea0335c887e6e6e5535365c3a313b96b7Paul Westbrook         */
7544880b5dea0335c887e6e6e5535365c3a313b96b7Paul Westbrook        public static final String ALL_NOTIFICATIONS = "all_notifications";
7554880b5dea0335c887e6e6e5535365c3a313b96b7Paul Westbrook
75651144944c2088299ebc2584cc09c61c23eb18659Marc Blank        private ConversationListQueryParameters() {}
75751144944c2088299ebc2584cc09c61c23eb18659Marc Blank    }
75851144944c2088299ebc2584cc09c61c23eb18659Marc Blank
7593a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira    // We define a "folder" as anything that contains a list of conversations.
7603a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira    public static final String FOLDER_LIST_TYPE =
7613a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira            "vnd.android.cursor.dir/vnd.com.android.mail.folder";
7623a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira    public static final String FOLDER_TYPE =
763750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira            "vnd.android.cursor.item/vnd.com.android.mail.folder";
7643a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira
7653a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira    public static final String[] FOLDERS_PROJECTION = {
76670147a965b87d969f394af002c1a1e535394cad3Tony Mantler        FolderColumns._ID,
767d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy        FolderColumns.PERSISTENT_ID,
7686349a043bce28ec999d72635222ae0eb576eb9cdMindy Pereira        FolderColumns.URI,
7693a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira        FolderColumns.NAME,
770750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira        FolderColumns.HAS_CHILDREN,
7710973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira        FolderColumns.CAPABILITIES,
7720973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira        FolderColumns.SYNC_WINDOW,
773750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira        FolderColumns.CONVERSATION_LIST_URI,
774bd8f51c4b1f06e5faca8498bff2a6fed85ed7946Mindy Pereira        FolderColumns.CHILD_FOLDERS_LIST_URI,
77561bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy        FolderColumns.UNSEEN_COUNT,
776bd8f51c4b1f06e5faca8498bff2a6fed85ed7946Mindy Pereira        FolderColumns.UNREAD_COUNT,
777c8a994227b9c686d88ee05840544162711a85712Marc Blank        FolderColumns.TOTAL_COUNT,
7787752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira        FolderColumns.REFRESH_URI,
7799ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        FolderColumns.SYNC_STATUS,
7807866472df1b6cfee8345493e43468d854680fadcMindy Pereira        FolderColumns.LAST_SYNC_RESULT,
7817866472df1b6cfee8345493e43468d854680fadcMindy Pereira        FolderColumns.TYPE,
7829275a069355a0cc1b78882387220d5364404b537Mindy Pereira        FolderColumns.ICON_RES_ID,
78361bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy        FolderColumns.NOTIFICATION_ICON_RES_ID,
7849275a069355a0cc1b78882387220d5364404b537Mindy Pereira        FolderColumns.BG_COLOR,
78548a4aed2e943debf725564808944e7c9e46dce5dMarc Blank        FolderColumns.FG_COLOR,
786c1e8790e4a1a1ec9ae8cb33cf85df3753c944ff6Mindy Pereira        FolderColumns.LOAD_MORE_URI,
7877c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy        FolderColumns.HIERARCHICAL_DESC,
788a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal        FolderColumns.LAST_MESSAGE_TIMESTAMP,
789a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal        FolderColumns.PARENT_URI
7903a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira    };
7913a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira
79242fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler    public static final String[] FOLDERS_PROJECTION_WITH_UNREAD_SENDERS =
79342fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler            (new ImmutableList.Builder<String>()
79442fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler                    .addAll(ImmutableList.copyOf(FOLDERS_PROJECTION))
79542fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler                    .add(FolderColumns.UNREAD_SENDERS)
79642fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler                    .build().toArray(new String[0]));
79742fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler
7987e5de7a9825120dcc6c94230ec5cd61b178fedf2Mindy Pereira    public static final int FOLDER_ID_COLUMN = 0;
799d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_PERSISTENT_ID_COLUMN = 1;
800d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_URI_COLUMN = 2;
801d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_NAME_COLUMN = 3;
802d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_HAS_CHILDREN_COLUMN = 4;
803d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_CAPABILITIES_COLUMN = 5;
804d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_SYNC_WINDOW_COLUMN = 6;
805d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_CONVERSATION_LIST_URI_COLUMN = 7;
806d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int FOLDER_CHILD_FOLDERS_LIST_COLUMN = 8;
80761bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_UNSEEN_COUNT_COLUMN = 9;
80861bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_UNREAD_COUNT_COLUMN = 10;
80961bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_TOTAL_COUNT_COLUMN = 11;
81061bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_REFRESH_URI_COLUMN = 12;
81161bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_SYNC_STATUS_COLUMN = 13;
81261bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_LAST_SYNC_RESULT_COLUMN = 14;
81361bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_TYPE_COLUMN = 15;
81461bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_ICON_RES_ID_COLUMN = 16;
81561bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_NOTIFICATION_ICON_RES_ID_COLUMN = 17;
81661bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_BG_COLOR_COLUMN = 18;
81761bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_FG_COLOR_COLUMN = 19;
81861bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_LOAD_MORE_URI_COLUMN = 20;
81961bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy    public static final int FOLDER_HIERARCHICAL_DESC_COLUMN = 21;
8207c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    public static final int FOLDER_LAST_MESSAGE_TIMESTAMP_COLUMN = 22;
821a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal    public static final int FOLDER_PARENT_URI_COLUMN = 23;
8227866472df1b6cfee8345493e43468d854680fadcMindy Pereira
8237866472df1b6cfee8345493e43468d854680fadcMindy Pereira    public static final class FolderType {
82458cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A user defined label. */
8258c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int DEFAULT = 1 << 0;
82658cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A system defined inbox */
8278c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int INBOX = 1 << 1;
82858cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A system defined containing mails to be edited before sending. */
8298c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int DRAFT = 1 << 2;
83058cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A system defined folder containing mails <b>to be</b> sent */
8318c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int OUTBOX = 1 << 3;
83258cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A system defined folder containing sent mails */
8338c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int SENT = 1 << 4;
83458cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A system defined trash folder */
8358c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int TRASH = 1 << 5;
83658cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A system defined spam folder */
8378c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int SPAM = 1 << 6;
83858cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** A system defined starred folder */
8398c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int STARRED = 1 << 7;
84058cad2eea744d41a11c0124e91308e38108d242eVikram Aggarwal        /** Any other system label that we do not have a specific name for. */
8418c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int OTHER_PROVIDER_FOLDER = 1 << 8;
842dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy        /** All mail folder */
8438c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int ALL_MAIL = 1 << 9;
844dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy        /** Gmail's inbox sections */
8458c1058ee75ec4a5824a68c3c5275bc48d56bbad8Scott Kennedy        public static final int INBOX_SECTION = 1 << 10;
846e58a66c44c0b6acf3a2ba42acb0ceb98c206324aAndrew Sapperstein        /** A system defined unread folder */
847e58a66c44c0b6acf3a2ba42acb0ceb98c206324aAndrew Sapperstein        public static final int UNREAD = 1 << 11;
848a158ac8a41239300a2f50b38ed17167aeef4ff4bScott Kennedy        /** A "fake" search folder */
849a158ac8a41239300a2f50b38ed17167aeef4ff4bScott Kennedy        public static final int SEARCH = 1 << 12;
8507866472df1b6cfee8345493e43468d854680fadcMindy Pereira    }
851818143e2163648acc0c91f123b84777d65cd70cfMindy Pereira
8520973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira    public static final class FolderCapabilities {
853bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler        // FEEL FREE TO USE 0x0001, 0x0002, 0x0004
854bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler        // was previously SYNCABLE, PARENT, CAN_HOLD_MAIL
855f33d7d469f861f8ebbe108c4ef90ef3fb348f224Andrew Sapperstein        // folders so we removed that value
8560973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira        public static final int CAN_ACCEPT_MOVED_MESSAGES = 0x0008;
857a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler
858a8352055eba7117f26d17137c3cc884faf216006Marc Blank         /**
859334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * For accounts that support archive, this will indicate that this folder supports
860334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * the archive functionality.
861334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         */
862334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        public static final int ARCHIVE = 0x0010;
863334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook
864334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        /**
8656102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook         * This will indicated that this folder supports the delete functionality.
8666102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook         */
8676102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int DELETE = 0x0020;
8686102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook
8696102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        /**
870334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * For accounts that support report spam, this will indicate that this folder supports
871334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * the report spam functionality.
872334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         */
8736102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int REPORT_SPAM = 0x0040;
874334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook
875334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        /**
87677eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook         * For accounts that support report spam, this will indicate that this folder supports
87776b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         * the mark not spam functionality.
87877eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook         */
8796102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int MARK_NOT_SPAM = 0x0080;
88077eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook
88177eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        /**
882334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * For accounts that support mute, this will indicate if a mute is performed from within
883334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * this folder, the action is destructive.
884334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         */
8856102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int DESTRUCTIVE_MUTE = 0x0100;
886a8352055eba7117f26d17137c3cc884faf216006Marc Blank
887a8352055eba7117f26d17137c3cc884faf216006Marc Blank        /**
888a8352055eba7117f26d17137c3cc884faf216006Marc Blank         * Indicates that a folder supports settings (sync lookback, etc.)
889a8352055eba7117f26d17137c3cc884faf216006Marc Blank         */
8906102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int SUPPORTS_SETTINGS = 0x0200;
891a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler
89204dc819886abc2e4f56e644b03449e29cdbae2d0Vikram Aggarwal        /**
89304dc819886abc2e4f56e644b03449e29cdbae2d0Vikram Aggarwal         * All the messages in this folder are important.
89404dc819886abc2e4f56e644b03449e29cdbae2d0Vikram Aggarwal         */
8956102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int ONLY_IMPORTANT = 0x0400;
896a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler
897386243fd5fd2974133ba661ba43e47eb3d2bfcdfMarc Blank        /**
898386243fd5fd2974133ba661ba43e47eb3d2bfcdfMarc Blank         * Deletions in this folder can't be undone (could include archive if desirable)
899386243fd5fd2974133ba661ba43e47eb3d2bfcdfMarc Blank         */
9006102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int DELETE_ACTION_FINAL = 0x0800;
901a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler
902a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank        /**
903a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank         * This folder is virtual, i.e. contains conversations potentially pulled from other
904a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank         * folders, potentially even from different accounts.  Examples might be a "starred"
905a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank         * folder, or an "unread" folder (per account or provider-wide)
906a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank         */
9076102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int IS_VIRTUAL = 0x1000;
90876b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook
90976b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        /**
91076b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         * For accounts that support report phishing, this will indicate that this folder supports
91176b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         * the report phishing functionality.
91276b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         */
9136102c7d9e855597c9a8fd052832eb28618418e6ePaul Westbrook        public static final int REPORT_PHISHING = 0x2000;
9146f95dd20bb46603889793ffba83fc2772dc0abc7Rohan Shah
9156f95dd20bb46603889793ffba83fc2772dc0abc7Rohan Shah        /**
9166f95dd20bb46603889793ffba83fc2772dc0abc7Rohan Shah         * The flag indicates that the user has the ability to move conversations
9176f95dd20bb46603889793ffba83fc2772dc0abc7Rohan Shah         * from this folder.
9186f95dd20bb46603889793ffba83fc2772dc0abc7Rohan Shah         */
9196f95dd20bb46603889793ffba83fc2772dc0abc7Rohan Shah        public static final int ALLOWS_REMOVE_CONVERSATION = 0x4000;
920e7e0163126fa81af58ae6dbffc20adb610580fe2Scott Kennedy
921e7e0163126fa81af58ae6dbffc20adb610580fe2Scott Kennedy        /**
922e7e0163126fa81af58ae6dbffc20adb610580fe2Scott Kennedy         * The flag indicates that the user has the ability to move conversations to or from this
923e7e0163126fa81af58ae6dbffc20adb610580fe2Scott Kennedy         * Folder in the same operation as other Folder changes (usually through
924d3728048128f035c29090cf938c53bd4976eb562Scott Kennedy         * {@link com.android.mail.ui.MultiFoldersSelectionDialog}).
925e7e0163126fa81af58ae6dbffc20adb610580fe2Scott Kennedy         */
926e7e0163126fa81af58ae6dbffc20adb610580fe2Scott Kennedy        public static final int MULTI_MOVE = 0x8000;
927dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy
928dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy        /**
929dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy         * This flag indicates that a conversation may be moved from this folder into the account's
930dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy         * inbox.
931dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy         */
932dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy        public static final int ALLOWS_MOVE_TO_INBOX = 0x10000;
93310ea28ab588d8e922c0f78f0f47fe479739ec2cfJames Lemieux
93410ea28ab588d8e922c0f78f0f47fe479739ec2cfJames Lemieux        /**
93510ea28ab588d8e922c0f78f0f47fe479739ec2cfJames Lemieux         * For folders that typically represent outgoing mail, this indicates the client should
93610ea28ab588d8e922c0f78f0f47fe479739ec2cfJames Lemieux         * display recipients rather than the standard list of senders.
93710ea28ab588d8e922c0f78f0f47fe479739ec2cfJames Lemieux         */
93810ea28ab588d8e922c0f78f0f47fe479739ec2cfJames Lemieux        public static final int SHOW_RECIPIENTS = 0x20000;
939a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler
940a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler        /**
941a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler         * We only want the icons of certain folders to be tinted with their
942a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler         * {@link FolderColumns#BG_COLOR}, this indicates when we want that to happen.
943a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler         */
944a469bd23ae957d2907181f7ad67c14c07d8e8aa7Tony Mantler        public static final int TINT_ICON = 0x40000;
945bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler
946bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler        /**
947bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler         * We want to only show unseen count and never unread count for some folders. This differs
948bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler         * from {@link Folder#isUnreadCountHidden()} where the expected alternative is to show the
949bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler         * total count of messages. Here we wish to show either unseen or nothing at all.
950bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler         */
951bc2370402e8ed6862da46c2bc9b39be3d934952fTony Mantler        public static final int UNSEEN_COUNT_ONLY = 0x80000;
9520973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira    }
9530973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira
95470147a965b87d969f394af002c1a1e535394cad3Tony Mantler    public static final class FolderColumns implements BaseColumns {
9550b63e8d3839c5b9ffb98e2764b7d6d83dd11bf97Paul Westbrook        /**
956d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy         * This string column contains an id for the folder that is constant across devices, or
957d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy         * null if there is no constant id.
958d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy         */
959d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy        public static final String PERSISTENT_ID = "persistentId";
960d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy        /**
9610b63e8d3839c5b9ffb98e2764b7d6d83dd11bf97Paul Westbrook         * This string column contains the uri of the folder.
9620b63e8d3839c5b9ffb98e2764b7d6d83dd11bf97Paul Westbrook         */
9637752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira        public static final String URI = "folderUri";
9643a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira        /**
9653a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira         * This string column contains the human visible name for the folder.
9663a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira         */
9673a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira        public static final String NAME = "name";
9683a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira        /**
9690973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira         * This int column represents the capabilities of the folder specified by
9700973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira         * FolderCapabilities flags.
9710973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira         */
972b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String CAPABILITIES = "capabilities";
9730973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira        /**
974fc2277eafed6d6d047993fd50f3ec8cee23c6cd8Mindy Pereira         * This int column represents whether or not this folder has any
975750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         * child folders.
976750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         */
977b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String HAS_CHILDREN = "hasChildren";
978750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira        /**
9790973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira         * This int column represents how large the sync window is.
9800973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira         */
981b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String SYNC_WINDOW = "syncWindow";
9820973b200bf5da8c7b026561cf581303d7a7f1f20Mindy Pereira        /**
983750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         * This string column contains the content provider uri to return the
984750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         * list of conversations for this folder.
9853a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira         */
9863a565bfee87ea7b56c02f66e8139a3b7a0fdf718Mindy Pereira        public static final String CONVERSATION_LIST_URI = "conversationListUri";
987750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira        /**
988750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         * This string column contains the content provider uri to return the
989750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         * list of child folders of this folder.
990750cc737974ada080cafe6aa1bf496bc8b2e3063Mindy Pereira         */
9917752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira        public static final String CHILD_FOLDERS_LIST_URI = "childFoldersListUri";
99261bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy        /**
99361bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         * This int column contains the current unseen count for the folder, if known.
99461bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         */
99561bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy        public static final String UNSEEN_COUNT = "unseenCount";
99661bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy        /**
99761bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         * This int column contains the current unread count for the folder.
99861bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         */
9997752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira        public static final String UNREAD_COUNT = "unreadCount";
1000bd8f51c4b1f06e5faca8498bff2a6fed85ed7946Mindy Pereira
10017752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira        public static final String TOTAL_COUNT = "totalCount";
10029c002107b4f3f052f744bb54a4ddca0f09a99d9eMindy Pereira        /**
10039c002107b4f3f052f744bb54a4ddca0f09a99d9eMindy Pereira         * This string column contains the content provider uri to force a
10049c002107b4f3f052f744bb54a4ddca0f09a99d9eMindy Pereira         * refresh of this folder.
10059c002107b4f3f052f744bb54a4ddca0f09a99d9eMindy Pereira         */
10067752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira        public static final  String REFRESH_URI = "refreshUri";
10077752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira        /**
10089ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         * This int column contains current sync status of the folder; some combination of the
10099ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         * SyncStatus bits defined above
10109ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         */
10119ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final String SYNC_STATUS  = "syncStatus";
10129ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        /**
10139ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         * This int column contains the sync status of the last sync attempt; one of the
10149ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank         * LastSyncStatus values defined above
10157752864ebcff53a682c2b615802a675908c3d8fcMindy Pereira         */
10169ace18a77e1c61700291f6116bb8162c8fce1fadMarc Blank        public static final String LAST_SYNC_RESULT  = "lastSyncResult";
10177866472df1b6cfee8345493e43468d854680fadcMindy Pereira        /**
101861bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         * This int column contains the icon res id for this folder, or 0 if there is none.
10197866472df1b6cfee8345493e43468d854680fadcMindy Pereira         */
10207866472df1b6cfee8345493e43468d854680fadcMindy Pereira        public static final String ICON_RES_ID = "iconResId";
10217866472df1b6cfee8345493e43468d854680fadcMindy Pereira        /**
102261bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         * This int column contains the notification icon res id for this folder, or 0 if there is
102361bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         * none.
102461bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy         */
102561bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy        public static final String NOTIFICATION_ICON_RES_ID = "notificationIconResId";
102661bd0e84a3b0545a722bbfe931233b47afdf52e2Scott Kennedy        /**
10277866472df1b6cfee8345493e43468d854680fadcMindy Pereira         * This int column contains the type of the folder. Zero is default.
10287866472df1b6cfee8345493e43468d854680fadcMindy Pereira         */
10297866472df1b6cfee8345493e43468d854680fadcMindy Pereira        public static final String TYPE = "type";
10309275a069355a0cc1b78882387220d5364404b537Mindy Pereira        /**
10319275a069355a0cc1b78882387220d5364404b537Mindy Pereira         * String representing the integer background color associated with this
10329275a069355a0cc1b78882387220d5364404b537Mindy Pereira         * folder, or null.
10339275a069355a0cc1b78882387220d5364404b537Mindy Pereira         */
10349275a069355a0cc1b78882387220d5364404b537Mindy Pereira        public static final String BG_COLOR = "bgColor";
10359275a069355a0cc1b78882387220d5364404b537Mindy Pereira        /**
10369275a069355a0cc1b78882387220d5364404b537Mindy Pereira         * String representing the integer of the foreground color associated
10379275a069355a0cc1b78882387220d5364404b537Mindy Pereira         * with this folder, or null.
10389275a069355a0cc1b78882387220d5364404b537Mindy Pereira         */
10399275a069355a0cc1b78882387220d5364404b537Mindy Pereira        public static final String FG_COLOR = "fgColor";
104048a4aed2e943debf725564808944e7c9e46dce5dMarc Blank        /**
104148a4aed2e943debf725564808944e7c9e46dce5dMarc Blank         * String with the content provider Uri used to request more items in the folder, or null.
104248a4aed2e943debf725564808944e7c9e46dce5dMarc Blank         */
104348a4aed2e943debf725564808944e7c9e46dce5dMarc Blank        public static final String LOAD_MORE_URI = "loadMoreUri";
104427d89ada3e8d1b17357a7064e1f47f3c15686412Vikram Aggarwal
1045c1e8790e4a1a1ec9ae8cb33cf85df3753c944ff6Mindy Pereira        /**
1046c1e8790e4a1a1ec9ae8cb33cf85df3753c944ff6Mindy Pereira         * Possibly empty string that describes the full hierarchy of a folder
1047c1e8790e4a1a1ec9ae8cb33cf85df3753c944ff6Mindy Pereira         * along with its name.
1048c1e8790e4a1a1ec9ae8cb33cf85df3753c944ff6Mindy Pereira         */
1049c1e8790e4a1a1ec9ae8cb33cf85df3753c944ff6Mindy Pereira        public static final String HIERARCHICAL_DESC = "hierarchicalDesc";
1050c1e8790e4a1a1ec9ae8cb33cf85df3753c944ff6Mindy Pereira
10517c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy        /**
10527c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy         * The timestamp of the last message received in this folder.
10537c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy         */
10547c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy        public static final String LAST_MESSAGE_TIMESTAMP = "lastMessageTimestamp";
10557c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
1056a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal        /**
1057a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal         * The URI, possibly null, of the parent folder.
1058a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal         */
1059a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal        public static final String PARENT_URI = "parentUri";
1060a3bbac02817b12e7641ba67f95d60ecd7794b500Vikram Aggarwal
106142fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler        /**
106242fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler         * A string of unread senders sorted by date, so we don't have to fetch this in multiple
106342fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler         * queries
106442fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler         */
106542fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler        public static final String UNREAD_SENDERS = "unreadSenders";
106642fe486e9e80a13d7f94573af1000f883a5d9dabTony Mantler
1067ff7d02ac1660d0f4bca9fce1f2033a6ea19c94c2Vikram Aggarwal        public FolderColumns() {}
10686f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    }
10696f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
1070a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    // We define a "folder" as anything that contains a list of conversations.
1071a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    public static final String CONVERSATION_LIST_TYPE =
1072a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira            "vnd.android.cursor.dir/vnd.com.android.mail.conversation";
1073a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    public static final String CONVERSATION_TYPE =
1074a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira            "vnd.android.cursor.item/vnd.com.android.mail.conversation";
1075a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira
10769cdc406b7b99915201a34e031c46b6f7ac5edc87Mindy Pereira
1077a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    public static final String[] CONVERSATION_PROJECTION = {
1078a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        BaseColumns._ID,
10796349a043bce28ec999d72635222ae0eb576eb9cdMindy Pereira        ConversationColumns.URI,
1080f9573c5f07bcc05409b5d4c15772884c5313c407Mindy Pereira        ConversationColumns.MESSAGE_LIST_URI,
1081a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        ConversationColumns.SUBJECT,
1082f9573c5f07bcc05409b5d4c15772884c5313c407Mindy Pereira        ConversationColumns.SNIPPET,
1083648df3f0b0ebcd3c4adf907d70ff0938e5dfc78fMindy Pereira        ConversationColumns.CONVERSATION_INFO,
1084f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        ConversationColumns.DATE_RECEIVED_MS,
10854db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        ConversationColumns.HAS_ATTACHMENTS,
10864db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        ConversationColumns.NUM_MESSAGES,
10874db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        ConversationColumns.NUM_DRAFTS,
10884db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        ConversationColumns.SENDING_STATE,
1089c8a994227b9c686d88ee05840544162711a85712Marc Blank        ConversationColumns.PRIORITY,
1090c8a994227b9c686d88ee05840544162711a85712Marc Blank        ConversationColumns.READ,
1091d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy        ConversationColumns.SEEN,
109236b6c8b6e87505ec106c7884e117db279d75c427Mindy Pereira        ConversationColumns.STARRED,
109322657529437c160dec072115c5982409306c1313Mindy Pereira        ConversationColumns.RAW_FOLDERS,
109422657529437c160dec072115c5982409306c1313Mindy Pereira        ConversationColumns.FLAGS,
109587d535fe423d782c3a0343c649330d309976f655Mindy Pereira        ConversationColumns.PERSONAL_LEVEL,
109687d535fe423d782c3a0343c649330d309976f655Mindy Pereira        ConversationColumns.SPAM,
109776b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        ConversationColumns.PHISHING,
109892939fc7b40a56e17fb0d2fde987133ca1614e29Marc Blank        ConversationColumns.MUTED,
1099a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank        ConversationColumns.COLOR,
1100648df3f0b0ebcd3c4adf907d70ff0938e5dfc78fMindy Pereira        ConversationColumns.ACCOUNT_URI,
110141dca185f7683b36bdafd9520c0648c897a95834Paul Westbrook        ConversationColumns.SENDER_INFO,
1102f98bc898cbc7014a203c35a13427d3f949bce705Andy Huang        ConversationColumns.CONVERSATION_BASE_URI,
1103479505d71969e26b0785d8e0e1b81108731cf827Mark Wei        ConversationColumns.REMOTE,
1104c92dc65f64e8b09ee78ba2fa799d7d3627373913Alan Lau        ConversationColumns.ORDER_KEY
1105a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    };
1106a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira
11075bb0f80d9c7fe3d652b1b81960c58110a7ea660dPaul Westbrook    /**
11085bb0f80d9c7fe3d652b1b81960c58110a7ea660dPaul Westbrook     * This integer corresponds to the number of rows of queries that specify the
11095bb0f80d9c7fe3d652b1b81960c58110a7ea660dPaul Westbrook     * {@link UIProvider#CONVERSATION_PROJECTION} projection will fit in a single
11105bb0f80d9c7fe3d652b1b81960c58110a7ea660dPaul Westbrook     * {@link android.database.CursorWindow}
11115bb0f80d9c7fe3d652b1b81960c58110a7ea660dPaul Westbrook     */
111284a21cea704f6123721d7589f92963011701cb13Tony Mantler    public static final int CONVERSATION_PROJECTION_QUERY_CURSOR_WINDOW_LIMIT = 1500;
11135bb0f80d9c7fe3d652b1b81960c58110a7ea660dPaul Westbrook
1114fdd984b69cabc5951eec269a23d42898ea70360fMindy Pereira    // These column indexes only work when the caller uses the
1115fdd984b69cabc5951eec269a23d42898ea70360fMindy Pereira    // default CONVERSATION_PROJECTION defined above.
1116fa7ef6e5023ed9bc1f2d9f3eea427afe5b78eb2aMindy Pereira    public static final int CONVERSATION_ID_COLUMN = 0;
11173263fa9bc22e6c99543bce1dc07310e964cd2a57Mindy Pereira    public static final int CONVERSATION_URI_COLUMN = 1;
11183263fa9bc22e6c99543bce1dc07310e964cd2a57Mindy Pereira    public static final int CONVERSATION_MESSAGE_LIST_URI_COLUMN = 2;
11193263fa9bc22e6c99543bce1dc07310e964cd2a57Mindy Pereira    public static final int CONVERSATION_SUBJECT_COLUMN = 3;
11203263fa9bc22e6c99543bce1dc07310e964cd2a57Mindy Pereira    public static final int CONVERSATION_SNIPPET_COLUMN = 4;
1121648df3f0b0ebcd3c4adf907d70ff0938e5dfc78fMindy Pereira    public static final int CONVERSATION_INFO_COLUMN = 5;
11223263fa9bc22e6c99543bce1dc07310e964cd2a57Mindy Pereira    public static final int CONVERSATION_DATE_RECEIVED_MS_COLUMN = 6;
11233263fa9bc22e6c99543bce1dc07310e964cd2a57Mindy Pereira    public static final int CONVERSATION_HAS_ATTACHMENTS_COLUMN = 7;
11244db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira    public static final int CONVERSATION_NUM_MESSAGES_COLUMN = 8;
11254db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira    public static final int CONVERSATION_NUM_DRAFTS_COLUMN = 9;
11264db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira    public static final int CONVERSATION_SENDING_STATE_COLUMN = 10;
11274db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira    public static final int CONVERSATION_PRIORITY_COLUMN = 11;
1128c8a994227b9c686d88ee05840544162711a85712Marc Blank    public static final int CONVERSATION_READ_COLUMN = 12;
1129d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_SEEN_COLUMN = 13;
1130d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_STARRED_COLUMN = 14;
1131d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_RAW_FOLDERS_COLUMN = 15;
1132d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_FLAGS_COLUMN = 16;
1133d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_PERSONAL_LEVEL_COLUMN = 17;
1134d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_IS_SPAM_COLUMN = 18;
1135d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_IS_PHISHING_COLUMN = 19;
1136d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_MUTED_COLUMN = 20;
1137d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_COLOR_COLUMN = 21;
1138d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_ACCOUNT_URI_COLUMN = 22;
1139d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_SENDER_INFO_COLUMN = 23;
1140d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_BASE_URI_COLUMN = 24;
1141d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy    public static final int CONVERSATION_REMOTE_COLUMN = 25;
11420e29e769c74e385342fc5dc8e9c85517771aaa34James Lemieux    public static final int CONVERSATION_ORDER_KEY_COLUMN = 26;
11434db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira
11444db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira    public static final class ConversationSendingState {
1145a457137806ef3384099fb60e71a39236c65d4e62Mindy Pereira        public static final int OTHER = 0;
11462c636308d67600a93a5eeb1d994ddc846a82e65bPaul Westbrook        public static final int QUEUED = 1;
11472c636308d67600a93a5eeb1d994ddc846a82e65bPaul Westbrook        public static final int SENDING = 2;
11482c636308d67600a93a5eeb1d994ddc846a82e65bPaul Westbrook        public static final int SENT = 3;
11496a2df258316b267151296556dbbdba20200ecb1fJin Cao        public static final int RETRYING = 4;
11504db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        public static final int SEND_ERROR = -1;
1151859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal    }
11524db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira
11534db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira    public static final class ConversationPriority {
115422657529437c160dec072115c5982409306c1313Mindy Pereira        public static final int DEFAULT = 0;
115522657529437c160dec072115c5982409306c1313Mindy Pereira        public static final int IMPORTANT = 1;
11564db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        public static final int LOW = 0;
11574db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        public static final int HIGH = 1;
1158859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal    }
1159fa7ef6e5023ed9bc1f2d9f3eea427afe5b78eb2aMindy Pereira
116022657529437c160dec072115c5982409306c1313Mindy Pereira    public static final class ConversationPersonalLevel {
116122657529437c160dec072115c5982409306c1313Mindy Pereira        public static final int NOT_TO_ME = 0;
116222657529437c160dec072115c5982409306c1313Mindy Pereira        public static final int TO_ME_AND_OTHERS = 1;
116322657529437c160dec072115c5982409306c1313Mindy Pereira        public static final int ONLY_TO_ME = 2;
116422657529437c160dec072115c5982409306c1313Mindy Pereira    }
116522657529437c160dec072115c5982409306c1313Mindy Pereira
1166c8a994227b9c686d88ee05840544162711a85712Marc Blank    public static final class ConversationFlags {
1167c8a994227b9c686d88ee05840544162711a85712Marc Blank        public static final int REPLIED = 1<<2;
1168c8a994227b9c686d88ee05840544162711a85712Marc Blank        public static final int FORWARDED = 1<<3;
1169d69f5ad0dc64c513ea86dc0c42fa6536f5e01998Mindy Pereira        public static final int CALENDAR_INVITE = 1<<4;
1170859681bd80922fea91e71ecf867ee1ad7a7a5970Vikram Aggarwal    }
1171c8a994227b9c686d88ee05840544162711a85712Marc Blank
117276b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook    public static final class ConversationPhishing {
117376b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        public static final int NOT_PHISHING = 0;
117476b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        public static final int PHISHING = 1;
117576b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook    }
117676b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook
1177531488ed848766708252a5fdc01c4ecf0fd167d1Vikram Aggarwal    /**
1178531488ed848766708252a5fdc01c4ecf0fd167d1Vikram Aggarwal     * Names of columns representing fields in a Conversation.
1179531488ed848766708252a5fdc01c4ecf0fd167d1Vikram Aggarwal     */
1180a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    public static final class ConversationColumns {
11816349a043bce28ec999d72635222ae0eb576eb9cdMindy Pereira        public static final String URI = "conversationUri";
1182a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        /**
118327a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         * This string column contains the content provider uri to return the
118427a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         * list of messages for this conversation.
11859cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         * The cursor returned by this query can return a {@link android.os.Bundle}
11869cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         * from a call to {@link android.database.Cursor#getExtras()}.  This Bundle may have
11879cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         * values with keys listed in {@link CursorExtraKeys}
118827a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         */
118927a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira        public static final String MESSAGE_LIST_URI = "messageListUri";
119027a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira        /**
1191a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira         * This string column contains the subject string for a conversation.
1192a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira         */
1193a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        public static final String SUBJECT = "subject";
1194a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        /**
119527a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         * This string column contains the snippet string for a conversation.
1196a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira         */
119727a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira        public static final String SNIPPET = "snippet";
119827a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira        /**
1199648df3f0b0ebcd3c4adf907d70ff0938e5dfc78fMindy Pereira         * @deprecated
120027a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         */
1201f6fac0ae025efd7ad48675b2230a22cc7a8d6f74Mark Wei        @Deprecated
120227a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira        public static final String SENDER_INFO = "senderInfo";
120327a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira        /**
1204351ad4e87e0b0b98df9ca88266a8a63541dc5a81Andy Huang         * This blob column contains the byte-array representation of the Parceled
1205351ad4e87e0b0b98df9ca88266a8a63541dc5a81Andy Huang         * ConversationInfo object for a conversation.
12067f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         *
12077f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * @deprecated providers should implement
12087f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * {@link ConversationCursorCommand#COMMAND_GET_CONVERSATION_INFO} instead.
1209648df3f0b0ebcd3c4adf907d70ff0938e5dfc78fMindy Pereira         */
12107f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang        @Deprecated
1211648df3f0b0ebcd3c4adf907d70ff0938e5dfc78fMindy Pereira        public static final String CONVERSATION_INFO = "conversationInfo";
1212648df3f0b0ebcd3c4adf907d70ff0938e5dfc78fMindy Pereira        /**
121327a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         * This long column contains the time in ms of the latest update to a
121427a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         * conversation.
121527a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira         */
121627a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira        public static final String DATE_RECEIVED_MS = "dateReceivedMs";
121727a0cf01582a7a1902a300ff32dd0d60f8f544f0Mindy Pereira
1218f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        /**
1219f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira         * This boolean column contains whether any messages in this conversation
1220f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira         * have attachments.
1221f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira         */
1222f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        public static final String HAS_ATTACHMENTS = "hasAttachments";
1223f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira
12244db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        /**
12254db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * This int column contains the number of messages in this conversation.
12264db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * For unthreaded, this will always be 1.
12274db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         */
1228b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String NUM_MESSAGES = "numMessages";
12294db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira
12304db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        /**
12314db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * This int column contains the number of drafts associated with this
12324db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * conversation.
12334db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         */
1234b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String NUM_DRAFTS = "numDrafts";
12354db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira
12364db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        /**
12374db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * This int column contains the state of drafts and replies associated
12384db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * with this conversation. Use ConversationSendingState to interpret
12394db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * this field.
12404db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         */
1241b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String SENDING_STATE = "sendingState";
12424db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira
12434db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira        /**
12444db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * This int column contains the priority of this conversation. Use
12454db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         * ConversationPriority to interpret this field.
12464db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira         */
1247b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String PRIORITY = "priority";
12484db59c58c0af9f44d95a12dbe21322bed58cc518Mindy Pereira
1249c8a994227b9c686d88ee05840544162711a85712Marc Blank        /**
125087d535fe423d782c3a0343c649330d309976f655Mindy Pereira         * This int column indicates whether the conversation has been read
1251c8a994227b9c686d88ee05840544162711a85712Marc Blank         */
1252b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String READ = "read";
1253d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy
1254d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy        /**
1255d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy         * This int column indicates whether the conversation has been seen
1256d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy         */
1257b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String SEEN = "seen";
1258d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy
1259c8a994227b9c686d88ee05840544162711a85712Marc Blank        /**
126087d535fe423d782c3a0343c649330d309976f655Mindy Pereira         * This int column indicates whether the conversation has been starred
1261c8a994227b9c686d88ee05840544162711a85712Marc Blank         */
1262b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String STARRED = "starred";
1263c8a994227b9c686d88ee05840544162711a85712Marc Blank
126436b6c8b6e87505ec106c7884e117db279d75c427Mindy Pereira        /**
1265b2033d855ab0f13e253e5403ce25989bcbc49488Andy Huang         * This blob column contains the marshalled form of a Parceled
1266b2033d855ab0f13e253e5403ce25989bcbc49488Andy Huang         * {@FolderList} object. Ideally, only ever use this for
1267b2033d855ab0f13e253e5403ce25989bcbc49488Andy Huang         * rendering the folder list for a conversation.
12687f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         *
12697f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * @deprecated providers should implement
12707f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * {@link ConversationCursorCommand#COMMAND_GET_RAW_FOLDERS} instead.
1271cc8211df898ba9dac17a766b89f28d6e6f0afef0Mindy Pereira         */
12727f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang        @Deprecated
1273183718b76a76c7b3ad907d8e959e8525e7836426Mindy Pereira        public static final String RAW_FOLDERS = "rawFolders";
127422657529437c160dec072115c5982409306c1313Mindy Pereira        public static final String FLAGS = "conversationFlags";
12751284fd6e98a1e6757742c1fcc18ab0a1cc7aacddAndy Huang        /**
12761284fd6e98a1e6757742c1fcc18ab0a1cc7aacddAndy Huang         * This int column indicates the personal level of a conversation per
12771284fd6e98a1e6757742c1fcc18ab0a1cc7aacddAndy Huang         * {@link ConversationPersonalLevel}.
12781284fd6e98a1e6757742c1fcc18ab0a1cc7aacddAndy Huang         */
127922657529437c160dec072115c5982409306c1313Mindy Pereira        public static final String PERSONAL_LEVEL = "personalLevel";
128087d535fe423d782c3a0343c649330d309976f655Mindy Pereira
128187d535fe423d782c3a0343c649330d309976f655Mindy Pereira        /**
128287d535fe423d782c3a0343c649330d309976f655Mindy Pereira         * This int column indicates whether the conversation is marked spam.
128387d535fe423d782c3a0343c649330d309976f655Mindy Pereira         */
128487d535fe423d782c3a0343c649330d309976f655Mindy Pereira        public static final String SPAM = "spam";
128587d535fe423d782c3a0343c649330d309976f655Mindy Pereira
128687d535fe423d782c3a0343c649330d309976f655Mindy Pereira        /**
128776b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         * This int column indicates whether the conversation is marked phishing.
128876b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         */
128976b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        public static final String PHISHING = "phishing";
129076b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook
129176b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        /**
129287d535fe423d782c3a0343c649330d309976f655Mindy Pereira         * This int column indicates whether the conversation was muted.
129387d535fe423d782c3a0343c649330d309976f655Mindy Pereira         */
129487d535fe423d782c3a0343c649330d309976f655Mindy Pereira        public static final String MUTED = "muted";
129587d535fe423d782c3a0343c649330d309976f655Mindy Pereira
129692939fc7b40a56e17fb0d2fde987133ca1614e29Marc Blank        /**
129792939fc7b40a56e17fb0d2fde987133ca1614e29Marc Blank         * This int column contains a color for the conversation (used in Email only)
129892939fc7b40a56e17fb0d2fde987133ca1614e29Marc Blank         */
129992939fc7b40a56e17fb0d2fde987133ca1614e29Marc Blank        public static final String COLOR = "color";
130092939fc7b40a56e17fb0d2fde987133ca1614e29Marc Blank
1301a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank        /**
1302a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank         * This String column contains the Uri for this conversation's account
1303a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank         */
1304a6b671dd9f5ba358a05888b3ab3bf1c5cb5cf493Marc Blank        public static final String ACCOUNT_URI = "accountUri";
130566bc2aaf76bb0dfa4fc38f8fcbaaf9e413e321ddVikram Aggarwal        /**
1306f98bc898cbc7014a203c35a13427d3f949bce705Andy Huang         * This int column indicates whether a conversation is remote (non-local), and would require
1307f98bc898cbc7014a203c35a13427d3f949bce705Andy Huang         * a network fetch to load.
1308f98bc898cbc7014a203c35a13427d3f949bce705Andy Huang         */
1309f98bc898cbc7014a203c35a13427d3f949bce705Andy Huang        public static final String REMOTE = "remote";
1310f98bc898cbc7014a203c35a13427d3f949bce705Andy Huang        /**
131166bc2aaf76bb0dfa4fc38f8fcbaaf9e413e321ddVikram Aggarwal         * This int column indicates whether the conversation was displayed on the UI and the
131266bc2aaf76bb0dfa4fc38f8fcbaaf9e413e321ddVikram Aggarwal         * user got a chance to read it. The UI does not read this value, it is meant only to
131366bc2aaf76bb0dfa4fc38f8fcbaaf9e413e321ddVikram Aggarwal         * write the status back to the provider. As a result, it is not available in the
131466bc2aaf76bb0dfa4fc38f8fcbaaf9e413e321ddVikram Aggarwal         * {@link Conversation} object.
131566bc2aaf76bb0dfa4fc38f8fcbaaf9e413e321ddVikram Aggarwal         */
1316f98bc898cbc7014a203c35a13427d3f949bce705Andy Huang        public static final String VIEWED = "viewed";
131741dca185f7683b36bdafd9520c0648c897a95834Paul Westbrook        /**
131841dca185f7683b36bdafd9520c0648c897a95834Paul Westbrook         * This String column contains the base uri for this conversation.  This uri can be used
131941dca185f7683b36bdafd9520c0648c897a95834Paul Westbrook         * when handling relative urls in the message content
132041dca185f7683b36bdafd9520c0648c897a95834Paul Westbrook         */
132141dca185f7683b36bdafd9520c0648c897a95834Paul Westbrook        public static final String CONVERSATION_BASE_URI = "conversationBaseUri";
132241dca185f7683b36bdafd9520c0648c897a95834Paul Westbrook
1323479505d71969e26b0785d8e0e1b81108731cf827Mark Wei        /**
1324c92dc65f64e8b09ee78ba2fa799d7d3627373913Alan Lau         * This long column contains the data that is used for ordering the result.
1325c92dc65f64e8b09ee78ba2fa799d7d3627373913Alan Lau         */
1326c92dc65f64e8b09ee78ba2fa799d7d3627373913Alan Lau        public static final String ORDER_KEY = "orderKey";
1327c92dc65f64e8b09ee78ba2fa799d7d3627373913Alan Lau
1328334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        private ConversationColumns() {
1329732600e38891db139bae02dc91dd0c5b0987e8e9Andy Huang        }
1330a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    }
1331a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira
1332ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang    public static final class ConversationCursorCommand {
1333ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang
1334ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang        public static final String COMMAND_RESPONSE_OK = "ok";
1335ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang        public static final String COMMAND_RESPONSE_FAILED = "failed";
1336ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang
1337ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang        /**
1338d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang         * Incoming bundles may include this key with an Integer bitfield value. See below for bit
1339d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang         * values.
1340d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang         */
1341d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang        public static final String COMMAND_KEY_OPTIONS = "options";
1342d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang
1343d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang        /**
1344d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang         * Clients must set this bit when the {@link Cursor#respond(Bundle)} call is being used to
1345d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang         * fetch a {@link Parcelable}. It serves as a hint that this call requires the cursor
1346d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang         * position to first safely be moved.
1347d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang         */
1348d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang        public static final int OPTION_MOVE_POSITION = 0x01;
1349d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang
1350d521baf3a51c9fc1306bd55e027ce57d0a1d18aaAndy Huang        /**
13519f119c72042e4d0382017d5ddcee9aa2113b6425Paul Westbrook         * This bundle key has a boolean value: true to indicate that this cursor has been shown
13529f119c72042e4d0382017d5ddcee9aa2113b6425Paul Westbrook         * to the user.
135369b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * <p>
135469b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * A provider that implements this command should include this key in its response with a
135569b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * value of {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}.
13569f119c72042e4d0382017d5ddcee9aa2113b6425Paul Westbrook         */
13579f119c72042e4d0382017d5ddcee9aa2113b6425Paul Westbrook        public static final String COMMAND_KEY_SET_VISIBILITY = "setVisibility";
13589f119c72042e4d0382017d5ddcee9aa2113b6425Paul Westbrook
135969b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal        /**
136069b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * This key has a boolean value: true to indicate that this folder list is shown to the user
136169b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * either on first call (launcher/widget/notification) or after switching from an existing
136269b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * folder: Inbox -> Folder. Repeated calls are sent when switching back to the folder. Inbox
136369b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * -> Folder -> Spam -> Folder will generate two calls to respond() with the value true for
136469b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * "Folder".
136569b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * <p>
136669b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * A provider that implements this command should include the
136769b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * {@link #COMMAND_KEY_SET_VISIBILITY} key in its response with a value of
136869b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}. This is <b>always</b>
136969b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * set with {@link #COMMAND_KEY_SET_VISIBILITY} because this is only set when the folder
137069b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         * list is made visible.
137169b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal         */
137269b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal        public static final String COMMAND_KEY_ENTERED_FOLDER = "enteredFolder";
137369b5c304f9572f18c0fcb456d81cccf2e560c72fVikram Aggarwal
1374983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook        /**
1375983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook         * This key has an int value, indicating the position that the UI wants to notify the
1376983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook         * provider that the data from a specified row is being shown to the user.
1377983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook         * <p>
1378983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook         * A provider that implements this command should include the
1379983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook         * {@link #COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE} key in its response with a value of
1380983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook         * {@link #COMMAND_RESPONSE_OK} or {@link #COMMAND_RESPONSE_FAILED}.
1381983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook         */
1382983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook        public static final String COMMAND_NOTIFY_CURSOR_UI_POSITION_CHANGE = "uiPositionChange";
1383983a723931447b6261a2e42b25e6f931dba6de33Paul Westbrook
13847f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang        /**
13857f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * Rather than jamming a {@link ConversationInfo} into a byte-array blob to be read out of
13867f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * a cursor, providers can optionally implement this command to directly return the object
13877f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * in a Bundle.
13887f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * <p>
1389fa225db4767867509fd962ac671e054294d13702Andy Huang         * The requestor (UI code) will place a meaningless value in the request Bundle. The UI will
1390fa225db4767867509fd962ac671e054294d13702Andy Huang         * also move the cursor position to the desired place prior to calling respond(). Providers
1391fa225db4767867509fd962ac671e054294d13702Andy Huang         * should just use {@link Bundle#containsKey(String)} to check for this kind of request and
1392fa225db4767867509fd962ac671e054294d13702Andy Huang         * generate an object at the current cursor position.
13937f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * <p>
13947f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * A provider that implements this command should include the
13957f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * {@link #COMMAND_GET_CONVERSATION_INFO} key in its response with a
13967f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * {@link ConversationInfo} Parcelable object as its value.
13977f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         */
1398f8b613c1103952ae5cc1f8a5e6ae60aa62d73decAndy Huang        public static final String COMMAND_GET_CONVERSATION_INFO =
1399f8b613c1103952ae5cc1f8a5e6ae60aa62d73decAndy Huang                ConversationColumns.CONVERSATION_INFO;
14007f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang
14017f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang        /**
14027f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * Rather than jamming a {@link FolderList} into a byte-array blob to be read out of
14037f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * a cursor, providers can optionally implement this command to directly return the object
14047f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * in a Bundle.
14057f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * <p>
1406fa225db4767867509fd962ac671e054294d13702Andy Huang         * The requestor (UI code) will place a meaningless value in the request Bundle. The UI will
1407fa225db4767867509fd962ac671e054294d13702Andy Huang         * also move the cursor position to the desired place prior to calling respond(). Providers
1408fa225db4767867509fd962ac671e054294d13702Andy Huang         * should just use {@link Bundle#containsKey(String)} to check for this kind of request and
1409fa225db4767867509fd962ac671e054294d13702Andy Huang         * generate an object at the current cursor position.
14107f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * <p>
14117f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * A provider that implements this command should include the
14127f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * {@link #COMMAND_GET_RAW_FOLDERS} key in its response with a
14137f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         * {@link FolderList} Parcelable object as its value.
14147f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang         */
1415f8b613c1103952ae5cc1f8a5e6ae60aa62d73decAndy Huang        public static final String COMMAND_GET_RAW_FOLDERS = ConversationColumns.RAW_FOLDERS;
14167f39bbd358f7003a72ae2b480dfe38a84e830e5fAndy Huang
1417ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang        private ConversationCursorCommand() {}
1418ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang    }
1419ca85441f810fdcdd50d285ac5f0319078050c90dAndy Huang
14206f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    /**
1421334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * List of operations that can can be performed on a conversation. These operations are applied
1422334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * with {@link ContentProvider#update(Uri, ContentValues, String, String[])}
1423334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * where the conversation uri is specified, and the ContentValues specifies the operation to
1424334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * be performed.
1425334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * <p/>
1426334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * The operation to be performed is specified in the ContentValues by
1427334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * the {@link ConversationOperations#OPERATION_KEY}
1428334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * <p/>
1429334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * Note not all UI providers will support these operations.  {@link AccountCapabilities} can
1430334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook     * be used to determine which operations are supported.
14316f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira     */
1432334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook    public static final class ConversationOperations {
1433334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        /**
1434334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * ContentValues key used to specify the operation to be performed
1435334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         */
1436334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        public static final String OPERATION_KEY = "operation";
1437334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook
1438334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        /**
1439334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * Archive operation
1440334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         */
1441334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        public static final String ARCHIVE = "archive";
1442334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook
1443334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        /**
1444334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * Mute operation
1445334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         */
1446334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        public static final String MUTE = "mute";
1447334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook
1448334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        /**
1449334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         * Report spam operation
1450334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook         */
1451334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        public static final String REPORT_SPAM = "report_spam";
1452334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook
145377eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        /**
145477eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook         * Report not spam operation
145577eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook         */
145677eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook        public static final String REPORT_NOT_SPAM = "report_not_spam";
145777eee625cd8c317c605acfd06cd3a7e22120a0fdPaul Westbrook
145876b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        /**
145976b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         * Report phishing operation
146076b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook         */
146176b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook        public static final String REPORT_PHISHING = "report_phishing";
146276b2062b8c6d18a7b3a05292c385b47b0fcbd09fPaul Westbrook
1463ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook        /**
1464ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook         * Discard drafts operation
1465ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook         */
1466ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook        public static final String DISCARD_DRAFTS = "discard_drafts";
1467ef3625472596326b910a4445307d1a8eb8c9cc3fPaul Westbrook
1468cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp        /**
1469512821c11d89d49908f3cfdee0b582601f500f3dJin Cao         * Move all failed messages into drafts operation
1470512821c11d89d49908f3cfdee0b582601f500f3dJin Cao         */
1471512821c11d89d49908f3cfdee0b582601f500f3dJin Cao        public static final String MOVE_FAILED_TO_DRAFTS = "move_failed_to_drafts";
1472512821c11d89d49908f3cfdee0b582601f500f3dJin Cao
1473512821c11d89d49908f3cfdee0b582601f500f3dJin Cao        /**
1474cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp         * Update conversation folder(s) operation. ContentValues passed as part
1475cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp         * of this update will be of the format (FOLDERS_UPDATED, csv of updated
1476cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp         * folders) where the comma separated values of the updated folders will
1477cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp         * be of the format: folderuri/ADD_VALUE. ADD_VALUE will be true if the
1478cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp         * folder was added, false if it was removed.
1479cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp         */
1480cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp        public static final String FOLDERS_UPDATED = "folders_updated";
1481cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50mindyp        public static final String FOLDERS_UPDATED_SPLIT_PATTERN = ",";
14825109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook
14835109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook        public static final class Parameters {
14845109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook            /**
14855109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook             * Boolean indicating whether the undo for this operation should be suppressed
14865109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook             */
14875109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook            public static final String SUPPRESS_UNDO = "suppress_undo";
14885109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook
14895109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook            private Parameters() {}
14905109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook        }
14915109c516b5cac279b4f99271953a27dd9a4828d8Paul Westbrook
1492334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        private ConversationOperations() {
1493334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook        }
1494334e64af904085984cdcbecbcbc18cf488a9ceaePaul Westbrook    }
149582ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
149672e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook    /**
149772e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook     * Methods that can be "called" using the account uri, through
1498a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler     * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)}
1499a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler     * Note, the arg parmateter of call should be the account uri.
150072e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook     */
150172e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook    public static final class AccountCallMethods {
150272e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook        /**
150372e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         * Save message method.  The Bundle for the call to
1504a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the
1505a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * columns specified in {@link MessageColumns}, and if this is a save for an existing
1506a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * message, an entry for the {@link MessageColumns#URI} should reference the existing
1507a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * message
150872e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         *
150972e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         * The Bundle returned will contain the message uri in the returned bundled with the
151072e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         * {@link MessageColumns#URI} key.
151172e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         */
151272e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook        public static final String SAVE_MESSAGE = "save_message";
151372e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook
151472e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook        /**
151572e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         * Send message method.  The Bundle for the call to
1516a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the
1517a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * columns specified in {@link MessageColumns}, and if this is a send of an existing
1518a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * message, an entry for the {@link MessageColumns#URI} should reference the existing
1519a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * message
152072e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         *
152172e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         * The Bundle returned will contain the message uri in the returned bundled with the
152272e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         * {@link MessageColumns#URI} key.
152372e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook         */
152472e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook        public static final String SEND_MESSAGE = "send_message";
152572e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook
152653a615db980802911c8570a04e437b03500323c4Scott Banachowski        /**
152753a615db980802911c8570a04e437b03500323c4Scott Banachowski         * Change account method.  The Bundle for the call to
1528a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * {@link android.content.ContentResolver#call(Uri,String,String,Bundle)} should have the
1529a7165dd86312f145ab2de8a2d765a769a53abea6Tony Mantler         * columns specified in {@link SetCurrentAccountColumns}
153053a615db980802911c8570a04e437b03500323c4Scott Banachowski         *
153153a615db980802911c8570a04e437b03500323c4Scott Banachowski         * The Bundle returned will be empty.
153253a615db980802911c8570a04e437b03500323c4Scott Banachowski         */
153353a615db980802911c8570a04e437b03500323c4Scott Banachowski        public static final String SET_CURRENT_ACCOUNT = "set_current_account";
153453a615db980802911c8570a04e437b03500323c4Scott Banachowski
153572e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook        private AccountCallMethods() {}
153672e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook    }
153772e2ea860f66f496537e37ebc0ddd2c670d4c651Paul Westbrook
15383c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook    /**
15393c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook     * Keys used for parameters to {@link AccountCallMethods#SEND_MESSAGE} or
15403c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook     * {@link AccountCallMethods#SAVE_MESSAGE} methods.
15413c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook     */
15423c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook    public static final class SendOrSaveMethodParamKeys {
15433c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook        /**
15443c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook         * Bundle key used to store any opened file descriptors.
15453c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook         * The keys of this Bundle are the contentUri for each attachment, and the
15463c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook         * values are {@link android.os.ParcelFileDescriptor} objects.
15473c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook         */
15483c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook        public static final String OPENED_FD_MAP = "opened_fds";
15493c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook
15503c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook        private SendOrSaveMethodParamKeys() {}
15513c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook    }
15523c7f94d02ff557c955c5d191cef45361a10be5c9Paul Westbrook
155382ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook    public static final class DraftType {
155497c25be161de53aa55662ebf44f2d489ddd86deaAndy Huang        public static final int NOT_A_DRAFT = 0;
155597c25be161de53aa55662ebf44f2d489ddd86deaAndy Huang        public static final int COMPOSE = 1;
155697c25be161de53aa55662ebf44f2d489ddd86deaAndy Huang        public static final int REPLY = 2;
155797c25be161de53aa55662ebf44f2d489ddd86deaAndy Huang        public static final int REPLY_ALL = 3;
155897c25be161de53aa55662ebf44f2d489ddd86deaAndy Huang        public static final int FORWARD = 4;
155982ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook
156082ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        private DraftType() {}
15616f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    }
15626f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
15633b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein    /**
15643b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     * Class for the enum values to determine whether this
15653b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     * string should be displayed as a high priority warning
15663b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     * or a low priority warning. The current design has
15673b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     * high priority warnings in red while low priority warnings
15683b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     * are grey.
15693b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     */
15703b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein    public static final class SpamWarningLevel {
15713b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final int NO_WARNING = 0;
15723b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final int LOW_WARNING = 1;
15733b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final int HIGH_WARNING = 2;
15743b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein
15753b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        private SpamWarningLevel() {}
15763b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein    }
15773b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein
15783b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein    /**
15793b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     * Class for the enum values to determine which type
15803b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     * of link to show in the spam warning.
15813b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein     */
15823b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein    public static final class SpamWarningLinkType {
15833b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final int NO_LINK = 0;
15843b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final int IGNORE_WARNING = 1;
15853b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final int REPORT_PHISHING = 2;
15863b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein
15873b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        private SpamWarningLinkType() {}
15883b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein    }
15893b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein
1590a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    public static final String[] MESSAGE_PROJECTION = {
1591a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        BaseColumns._ID,
1592326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira        MessageColumns.SERVER_ID,
1593a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.URI,
1594a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.CONVERSATION_ID,
1595a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.SUBJECT,
1596a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.SNIPPET,
1597a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.FROM,
1598a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.TO,
1599a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.CC,
1600a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.BCC,
1601a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.REPLY_TO,
1602a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.DATE_RECEIVED_MS,
1603a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.BODY_HTML,
1604a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.BODY_TEXT,
1605a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.EMBEDS_EXTERNAL_RESOURCES,
1606a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.REF_MESSAGE_ID,
1607a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira        MessageColumns.DRAFT_TYPE,
16083ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira        MessageColumns.APPEND_REF_MESSAGE_CONTENT,
1609f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        MessageColumns.HAS_ATTACHMENTS,
1610326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira        MessageColumns.ATTACHMENT_LIST_URI,
1611934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux        MessageColumns.ATTACHMENT_BY_CID_URI,
1612f944e9655562e321aff52fe5f437e1d2fa2950a9Mindy Pereira        MessageColumns.MESSAGE_FLAGS,
1613e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira        MessageColumns.ALWAYS_SHOW_IMAGES,
1614d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang        MessageColumns.READ,
1615d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy        MessageColumns.SEEN,
1616d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang        MessageColumns.STARRED,
16175a9290731bf565538a9cf91892346c7a6f4da0ecAndy Huang        MessageColumns.QUOTE_START_POS,
161892551d057965689f1952faeb06763f0762bc717fMindy Pereira        MessageColumns.ATTACHMENTS,
161962de1b104635b09e7f00b0941268ba1fa5460ddbMindy Pereira        MessageColumns.CUSTOM_FROM_ADDRESS,
16203842af9e8ba90ebf5b75dc5018bbfdfb2e044f99Marc Blank        MessageColumns.MESSAGE_ACCOUNT_URI,
16213b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        MessageColumns.EVENT_INTENT_URI,
16223b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        MessageColumns.SPAM_WARNING_STRING,
16233b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        MessageColumns.SPAM_WARNING_LEVEL,
1624d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein        MessageColumns.SPAM_WARNING_LINK_TYPE,
162547aa9c991b33c722a6ba1946fc02e0aba17bc1c9Andy Huang        MessageColumns.VIA_DOMAIN,
16266a2df258316b267151296556dbbdba20200ecb1fJin Cao        MessageColumns.SENDING_STATE,
162720c2082e85e87dc9c70b3d74e20ed31d3eff7364Andrew Sapperstein        MessageColumns.CLIPPED,
162820c2082e85e87dc9c70b3d74e20ed31d3eff7364Andrew Sapperstein        MessageColumns.PERMALINK
1629a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    };
1630a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira
1631f944e9655562e321aff52fe5f437e1d2fa2950a9Mindy Pereira    /** Separates attachment info parts in strings in a message. */
16325c5fd571b40a15b95ea5a5d6033f377706ffd0fbAndy Huang    @Deprecated
1633f944e9655562e321aff52fe5f437e1d2fa2950a9Mindy Pereira    public static final String MESSAGE_ATTACHMENT_INFO_SEPARATOR = "\n";
1634a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    public static final String MESSAGE_LIST_TYPE =
1635a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira            "vnd.android.cursor.dir/vnd.com.android.mail.message";
1636a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira    public static final String MESSAGE_TYPE =
1637a1406077e7bfecd81c4c2bed0d21dedef3b6e168Mindy Pereira            "vnd.android.cursor.item/vnd.com.android.mail.message";
16386f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira
16396349a043bce28ec999d72635222ae0eb576eb9cdMindy Pereira    public static final int MESSAGE_ID_COLUMN = 0;
1640326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_SERVER_ID_COLUMN = 1;
1641326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_URI_COLUMN = 2;
164226846d859a4714ff90ea02dba251a54cac1f1e9fMarc Blank    public static final int MESSAGE_CONVERSATION_URI_COLUMN = 3;
1643326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_SUBJECT_COLUMN = 4;
1644326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_SNIPPET_COLUMN = 5;
1645326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_FROM_COLUMN = 6;
1646326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_TO_COLUMN = 7;
1647326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_CC_COLUMN = 8;
1648326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_BCC_COLUMN = 9;
1649326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_REPLY_TO_COLUMN = 10;
1650326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_DATE_RECEIVED_MS_COLUMN = 11;
16511666816f97b7d69124d25f61415b8e258357e4dbMindy Pereira    public static final int MESSAGE_BODY_HTML_COLUMN = 12;
16521666816f97b7d69124d25f61415b8e258357e4dbMindy Pereira    public static final int MESSAGE_BODY_TEXT_COLUMN = 13;
1653326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_EMBEDS_EXTERNAL_RESOURCES_COLUMN = 14;
1654a990a715012379451344246c5156d29938f12886Alice Yang    public static final int MESSAGE_REF_MESSAGE_URI_COLUMN = 15;
1655326c660df0a0a36a52ae74d8bafaa22d6f253561Mindy Pereira    public static final int MESSAGE_DRAFT_TYPE_COLUMN = 16;
16563ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira    public static final int MESSAGE_APPEND_REF_MESSAGE_CONTENT_COLUMN = 17;
16573ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira    public static final int MESSAGE_HAS_ATTACHMENTS_COLUMN = 18;
16583ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira    public static final int MESSAGE_ATTACHMENT_LIST_URI_COLUMN = 19;
1659934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_ATTACHMENT_BY_CID_URI_COLUMN = 20;
1660934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_FLAGS_COLUMN = 21;
1661934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_ALWAYS_SHOW_IMAGES_COLUMN = 22;
1662934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_READ_COLUMN = 23;
1663934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_SEEN_COLUMN = 24;
1664934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_STARRED_COLUMN = 25;
1665934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int QUOTED_TEXT_OFFSET_COLUMN = 26;
1666934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_ATTACHMENTS_COLUMN = 27;
1667934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_CUSTOM_FROM_ADDRESS_COLUMN = 28;
1668934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_ACCOUNT_URI_COLUMN = 29;
1669934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_EVENT_INTENT_COLUMN = 30;
1670934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_SPAM_WARNING_STRING_ID_COLUMN = 31;
1671934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_SPAM_WARNING_LEVEL_COLUMN = 32;
1672934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_SPAM_WARNING_LINK_TYPE_COLUMN = 33;
1673934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_VIA_DOMAIN_COLUMN = 34;
16746a2df258316b267151296556dbbdba20200ecb1fJin Cao    public static final int MESSAGE_SENDING_STATE_COLUMN = 35;
1675934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_CLIPPED_COLUMN = 36;
1676934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int MESSAGE_PERMALINK_COLUMN = 37;
16779cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
16789cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook    public static final class CursorStatus {
16799cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        // The cursor is actively loading more data
16809cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        public static final int LOADING =      1 << 0;
16819cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
16829cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        // The cursor is currently not loading more data, but more data may be available
16839cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        public static final int LOADED =       1 << 1;
16849cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
16859cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        // An error occured while loading data
16869cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        public static final int ERROR =        1 << 2;
16879cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
16889cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        // The cursor is loaded, and there will be no more data
16899cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        public static final int COMPLETE =     1 << 3;
1690573b9e698852c6cf2cbf0f93bc01b7abb8b64ce1Paul Westbrook
1691573b9e698852c6cf2cbf0f93bc01b7abb8b64ce1Paul Westbrook        public static boolean isWaitingForResults(int cursorStatus) {
1692573b9e698852c6cf2cbf0f93bc01b7abb8b64ce1Paul Westbrook            return 0 != (cursorStatus & LOADING);
1693573b9e698852c6cf2cbf0f93bc01b7abb8b64ce1Paul Westbrook        }
16949cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook    }
16959cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
16969cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
16979cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook    public static final class CursorExtraKeys {
16989cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        /**
16999cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         * This integer column contains the staus of the message cursor.  The value will be
17009cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         * one defined in {@link CursorStatus}.
17019cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         */
17027a3e657432d2ba01d6e04fbf8f9fd7b32eff591aPaul Westbrook        public static final String EXTRA_STATUS = "cursor_status";
17039cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
17049cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook        /**
17059cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         * Used for finding the cause of an error.
17069cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         * TODO: define these values
17079cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook         */
17087a3e657432d2ba01d6e04fbf8f9fd7b32eff591aPaul Westbrook        public static final String EXTRA_ERROR = "cursor_error";
17099cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
1710cbde5fa5dae7a730f916ab1ad5eda458d3dc8a34Yu Ping Hu
1711cbde5fa5dae7a730f916ab1ad5eda458d3dc8a34Yu Ping Hu        /**
1712cbde5fa5dae7a730f916ab1ad5eda458d3dc8a34Yu Ping Hu         * This integer column contains the total message count for this folder.
1713cbde5fa5dae7a730f916ab1ad5eda458d3dc8a34Yu Ping Hu         */
1714cbde5fa5dae7a730f916ab1ad5eda458d3dc8a34Yu Ping Hu        public static final String EXTRA_TOTAL_COUNT = "cursor_total_count";
17159cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook    }
17169cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
17172388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook    public static final class AccountCursorExtraKeys {
17182388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook        /**
17192388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook         * This integer column contains the staus of the account cursor.  The value will be
17202388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook         * 1 if all accounts have been fully loaded or 0 if the account list hasn't been fully
17212388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook         * initialized
17222388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook         */
17232388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook        public static final String ACCOUNTS_LOADED = "accounts_loaded";
17242388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook    }
17252388c5d208acd4e4e658aaacbbc5f080ee8e9f7cPaul Westbrook
17269cf4389cf2edd17bc2029cc566780b26f89985f8Paul Westbrook
1727f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    public static final class MessageFlags {
172847aa9c991b33c722a6ba1946fc02e0aba17bc1c9Andy Huang        public static final int REPLIED =           1 << 2;
172947aa9c991b33c722a6ba1946fc02e0aba17bc1c9Andy Huang        public static final int FORWARDED =         1 << 3;
173047aa9c991b33c722a6ba1946fc02e0aba17bc1c9Andy Huang        public static final int CALENDAR_INVITE =   1 << 4;
1731f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    }
1732f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira
17336f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    public static final class MessageColumns {
1734db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1735db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains a content provider URI that points to this single message.
1736db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17376349a043bce28ec999d72635222ae0eb576eb9cdMindy Pereira        public static final String URI = "messageUri";
1738db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1739db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains a server-assigned ID for this message.
1740db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
1741db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        public static final String SERVER_ID = "serverMessageId";
174282ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        public static final String CONVERSATION_ID = "conversationId";
1743db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1744db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains the subject of a message.
1745db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17466f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String SUBJECT = "subject";
1747db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1748db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains a snippet of the message body.
1749db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17506f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String SNIPPET = "snippet";
1751db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1752db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains the single email address (and optionally name) of the sender.
1753db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17546f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String FROM = "fromAddress";
1755db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1756db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains a comma-delimited list of "To:" recipient email addresses.
1757db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17586f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String TO = "toAddresses";
1759db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1760db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains a comma-delimited list of "CC:" recipient email addresses.
1761db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17626f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String CC = "ccAddresses";
1763db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1764db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains a comma-delimited list of "BCC:" recipient email addresses.
1765db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This value will be null for incoming messages.
1766db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17676f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String BCC = "bccAddresses";
1768db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1769db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains the single email address (and optionally name) of the
1770db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * sender's reply-to address.
1771db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
177282ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        public static final String REPLY_TO = "replyToAddress";
1773db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1774db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This long column contains the timestamp (in millis) of receipt of the message.
1775db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
17766f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String DATE_RECEIVED_MS = "dateReceivedMs";
1777db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1778db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains the HTML form of the message body, if available. If not,
1779db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * a provider must populate BODY_TEXT.
1780db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
178182ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        public static final String BODY_HTML = "bodyHtml";
1782db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1783db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This string column contains the plaintext form of the message body, if HTML is not
1784db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * otherwise available. If HTML is available, this value should be left empty (null).
1785db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
178682ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        public static final String BODY_TEXT = "bodyText";
17876f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String EMBEDS_EXTERNAL_RESOURCES = "bodyEmbedsExternalResources";
17883ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira        /**
17893ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira         * This string column contains an opaque string used by the sendMessage api.
17903ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira         */
17916f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        public static final String REF_MESSAGE_ID = "refMessageId";
1792db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
179397c25be161de53aa55662ebf44f2d489ddd86deaAndy Huang         * This integer column contains the type of this draft, or zero (0) if this message is not a
179497c25be161de53aa55662ebf44f2d489ddd86deaAndy Huang         * draft. See {@link DraftType} for possible values.
1795db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
179682ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook        public static final String DRAFT_TYPE = "draftType";
1797db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1798db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This boolean column indicates whether an outgoing message should trigger special quoted
1799db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * text processing upon send. The value should default to zero (0) for protocols that do
1800db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * not support or require this flag, and for all incoming messages.
1801db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
18023ce64e7ceb6246130342385d91550bcf33b31cc8Mindy Pereira        public static final String APPEND_REF_MESSAGE_CONTENT = "appendRefMessageContent";
1803db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1804db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This boolean column indicates whether a message has attachments. The list of attachments
1805db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * can be retrieved using the URI in {@link MessageColumns#ATTACHMENT_LIST_URI}.
1806db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
1807f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        public static final String HAS_ATTACHMENTS = "hasAttachments";
1808db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
18097ed1c1122c5677344a1ce176be2c03972fed26f5Mindy Pereira         * This string column contains the content provider URI for the list of
18104f347e811052f446c3958c76db278bcd7b39a44fAndy Huang         * attachments associated with this message.<br>
18114f347e811052f446c3958c76db278bcd7b39a44fAndy Huang         * <br>
18124f347e811052f446c3958c76db278bcd7b39a44fAndy Huang         * The resulting cursor MUST have the columns as defined in
18134f347e811052f446c3958c76db278bcd7b39a44fAndy Huang         * {@link com.android.ex.photo.provider.PhotoContract.PhotoViewColumns}.
1814db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
1815f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        public static final String ATTACHMENT_LIST_URI = "attachmentListUri";
1816db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang        /**
1817934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux         * This string column contains the content provider URI for the details of an attachment
1818934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux         * associated with this message. (CID to be appended at the time the URI is used)
1819934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux         */
1820934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux        public static final String ATTACHMENT_BY_CID_URI = "attachmentByCidUri";
1821934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux        /**
1822db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         * This long column is a bit field of flags defined in {@link MessageFlags}.
1823db97747e5adc0a5fdf38f0f7c7f3878156278424Andy Huang         */
1824732600e38891db139bae02dc91dd0c5b0987e8e9Andy Huang        public static final String MESSAGE_FLAGS = "messageFlags";
1825f944e9655562e321aff52fe5f437e1d2fa2950a9Mindy Pereira        /**
1826104f729c284f9b7b31a251350252f8ae31d09f86Paul Westbrook         * This integer column represents whether the user has specified that images should always
1827104f729c284f9b7b31a251350252f8ae31d09f86Paul Westbrook         * be shown.  The value of "1" indicates that the user has specified that images should be
1828104f729c284f9b7b31a251350252f8ae31d09f86Paul Westbrook         * shown, while the value of "0" indicates that the user should be prompted before loading
1829104f729c284f9b7b31a251350252f8ae31d09f86Paul Westbrook         * any external images.
1830104f729c284f9b7b31a251350252f8ae31d09f86Paul Westbrook         */
1831104f729c284f9b7b31a251350252f8ae31d09f86Paul Westbrook        public static final String ALWAYS_SHOW_IMAGES = "alwaysShowImages";
1832104f729c284f9b7b31a251350252f8ae31d09f86Paul Westbrook
1833e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira        /**
1834d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         * This boolean column indicates whether the message has been read
1835d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         */
1836b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String READ = "read";
1837d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang
1838d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang        /**
1839d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy         * This boolean column indicates whether the message has been seen
1840d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy         */
1841b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String SEEN = "seen";
1842d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy
1843d5edd2d02649dffb40065fdb6a16acf91552b800Scott Kennedy        /**
1844d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         * This boolean column indicates whether the message has been starred
1845d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         */
1846b8911730b9d87179cc77ac8336f7002c5e056c26Paul Westbrook        public static final String STARRED = "starred";
1847d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang
1848d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang        /**
1849e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira         * This integer column represents the offset in the message of quoted
1850e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira         * text. If include_quoted_text is zero, the value contained in this
1851e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira         * column is invalid.
1852e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira         */
1853e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira        public static final String QUOTE_START_POS = "quotedTextStartPos";
1854e8caf1279a1c6ae720215405f678172a5cbf68d7Mindy Pereira
18555a9290731bf565538a9cf91892346c7a6f4da0ecAndy Huang        /**
18565a9290731bf565538a9cf91892346c7a6f4da0ecAndy Huang         * This string columns contains a JSON array of serialized {@link Attachment} objects.
18575a9290731bf565538a9cf91892346c7a6f4da0ecAndy Huang         */
18585a9290731bf565538a9cf91892346c7a6f4da0ecAndy Huang        public static final String ATTACHMENTS = "attachments";
185992551d057965689f1952faeb06763f0762bc717fMindy Pereira        public static final String CUSTOM_FROM_ADDRESS = "customFrom";
186062de1b104635b09e7f00b0941268ba1fa5460ddbMindy Pereira        /**
186162de1b104635b09e7f00b0941268ba1fa5460ddbMindy Pereira         * Uri of the account associated with this message. Except in the case
186262de1b104635b09e7f00b0941268ba1fa5460ddbMindy Pereira         * of showing a combined view, this column is almost always empty.
186362de1b104635b09e7f00b0941268ba1fa5460ddbMindy Pereira         */
186462de1b104635b09e7f00b0941268ba1fa5460ddbMindy Pereira        public static final String MESSAGE_ACCOUNT_URI = "messageAccountUri";
18653842af9e8ba90ebf5b75dc5018bbfdfb2e044f99Marc Blank        /**
1866e623a0f6e3caa9cafec913cf826e946628833517Andy Huang         * Intent Uri to launch when the user wants to view an event in their calendar, or null.
18673842af9e8ba90ebf5b75dc5018bbfdfb2e044f99Marc Blank         */
18683842af9e8ba90ebf5b75dc5018bbfdfb2e044f99Marc Blank        public static final String EVENT_INTENT_URI = "eventIntentUri";
18693b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        /**
1870d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein         * This string column contains the string for the spam
18713b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         * warning of this message, or null if there is no spam warning for the message.
18723b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         */
18733b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final String SPAM_WARNING_STRING = "spamWarningString";
18743b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        /**
18753b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         * This integer column contains the level of spam warning of this message,
18763b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         * or zero (0) if this message does not have a warning level.
18773b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         * See {@link SpamWarningLevel} for possible values.
18783b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         */
18793b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final String SPAM_WARNING_LEVEL = "spamWarningLevel";
18803b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        /**
18813b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         * This integer column contains the type of link for the spam warning
18823b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         * of this message, or zero (0) if this message does not have a link type.
18833b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         * See {@link SpamWarningLinkType} for possible values.
18843b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein         */
18853b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein        public static final String SPAM_WARNING_LINK_TYPE = "spamWarningLinkType";
1886d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein        /**
1887d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein         * This string column contains the string for the via domain
1888d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein         * to be included if this message was sent via an alternate
1889d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein         * domain. This column should be null if no via domain exists.
1890d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein         */
1891d5b369b324a22d28b63def902eefaf6591edf004Andrew Sapperstein        public static final String VIA_DOMAIN = "viaDomain";
189247aa9c991b33c722a6ba1946fc02e0aba17bc1c9Andy Huang        /**
18936a2df258316b267151296556dbbdba20200ecb1fJin Cao         * This int column indicates whether the message is an outgoing message in the process
18946a2df258316b267151296556dbbdba20200ecb1fJin Cao         * of being sent. See {@link com.android.mail.providers.UIProvider.ConversationSendingState}
189547aa9c991b33c722a6ba1946fc02e0aba17bc1c9Andy Huang         */
18966a2df258316b267151296556dbbdba20200ecb1fJin Cao        public static final String SENDING_STATE = "sendingState";
1897f59d01c3116dc2adde97a5b52aa6094144c2d315Andrew Sapperstein        /**
1898f59d01c3116dc2adde97a5b52aa6094144c2d315Andrew Sapperstein         * This boolean column indicates whether the message body has been clipped.
1899f59d01c3116dc2adde97a5b52aa6094144c2d315Andrew Sapperstein         */
1900f59d01c3116dc2adde97a5b52aa6094144c2d315Andrew Sapperstein        public static final String CLIPPED = "clipped";
190120c2082e85e87dc9c70b3d74e20ed31d3eff7364Andrew Sapperstein        /**
190220c2082e85e87dc9c70b3d74e20ed31d3eff7364Andrew Sapperstein         * This string column contains the permalink value of the conversation
190320c2082e85e87dc9c70b3d74e20ed31d3eff7364Andrew Sapperstein         * for which this message belongs or null if one does not exist.
190420c2082e85e87dc9c70b3d74e20ed31d3eff7364Andrew Sapperstein         */
190520c2082e85e87dc9c70b3d74e20ed31d3eff7364Andrew Sapperstein        public static final String PERMALINK = "permalink";
19063b08c51ec46794b3c22c8649eb86bf77c72e0d9aAndrew Sapperstein
19076f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira        private MessageColumns() {}
19086f92de64bbdf1ea6c4cd9774fc96921a10c266d7Mindy Pereira    }
1909f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira
191053a615db980802911c8570a04e437b03500323c4Scott Banachowski     public static final class SetCurrentAccountColumns {
191153a615db980802911c8570a04e437b03500323c4Scott Banachowski        /**
191253a615db980802911c8570a04e437b03500323c4Scott Banachowski         * This column contains the Account object Parcelable.
191353a615db980802911c8570a04e437b03500323c4Scott Banachowski         */
191453a615db980802911c8570a04e437b03500323c4Scott Banachowski        public static final String ACCOUNT = "account";
191553a615db980802911c8570a04e437b03500323c4Scott Banachowski
191653a615db980802911c8570a04e437b03500323c4Scott Banachowski        private SetCurrentAccountColumns() {}
191753a615db980802911c8570a04e437b03500323c4Scott Banachowski    }
191853a615db980802911c8570a04e437b03500323c4Scott Banachowski
1919922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank    /**
1920922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank     * List of operations that can can be performed on a message. These operations are applied
1921922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank     * with {@link ContentProvider#update(Uri, ContentValues, String, String[])}
1922922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank     * where the message uri is specified, and the ContentValues specifies the operation to
1923922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank     * be performed, e.g. values.put(RESPOND_COLUMN, RESPOND_ACCEPT)
1924922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank     * <p/>
1925922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank     * Note not all UI providers will support these operations.
1926922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank     */
1927922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank    public static final class MessageOperations {
1928922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank        /**
1929922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank         * Respond to a calendar invitation
1930922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank         */
1931922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank        public static final String RESPOND_COLUMN = "respond";
1932922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank
1933922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank        public static final int RESPOND_ACCEPT = 1;
1934922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank        public static final int RESPOND_TENTATIVE = 2;
1935922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank        public static final int RESPOND_DECLINE = 3;
1936922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank
1937922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank        private MessageOperations() {
1938922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank        }
1939922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank    }
1940922c3eb11830813cd8f739d2a2d4ac5833b56d84Marc Blank
1941f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    public static final String ATTACHMENT_LIST_TYPE =
1942f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira            "vnd.android.cursor.dir/vnd.com.android.mail.attachment";
1943f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    public static final String ATTACHMENT_TYPE =
1944f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira            "vnd.android.cursor.item/vnd.com.android.mail.attachment";
1945f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira
1946f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    public static final String[] ATTACHMENT_PROJECTION = {
1947f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        AttachmentColumns.NAME,
1948f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        AttachmentColumns.SIZE,
19497a07fb4955e34250225287212b07d1b6f12bf671Mindy Pereira        AttachmentColumns.URI,
1950f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        AttachmentColumns.CONTENT_TYPE,
1951e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        AttachmentColumns.STATE,
1952e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        AttachmentColumns.DESTINATION,
1953e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        AttachmentColumns.DOWNLOADED_SIZE,
1954e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        AttachmentColumns.CONTENT_URI,
1955e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        AttachmentColumns.THUMBNAIL_URI,
1956bbe74aee04f669990e888095b0d6858dc1e17ce1Mark Wei        AttachmentColumns.PREVIEW_INTENT_URI,
19577434e800d4313a227120ca36bd95683752a7879fAndrew Sapperstein        AttachmentColumns.PROVIDER_DATA,
1958beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei        AttachmentColumns.SUPPORTS_DOWNLOAD_AGAIN,
1959519c218db6109003ca72a35ffe276ed69b0230a4Martin Hibdon        AttachmentColumns.TYPE,
1960934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux        AttachmentColumns.FLAGS,
1961934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux        AttachmentColumns.CONTENT_ID
1962f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    };
1963109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_NAME_COLUMN = 0;
1964109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_SIZE_COLUMN = 1;
1965109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_URI_COLUMN = 2;
1966109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_CONTENT_TYPE_COLUMN = 3;
1967109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_STATE_COLUMN = 4;
1968109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_DESTINATION_COLUMN = 5;
1969109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_DOWNLOADED_SIZE_COLUMN = 6;
1970109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_CONTENT_URI_COLUMN = 7;
1971109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_THUMBNAIL_URI_COLUMN = 8;
1972109369d52c80d25d1b02e769e2406656b0a8d4e4Andy Huang    public static final int ATTACHMENT_PREVIEW_INTENT_COLUMN = 9;
19737434e800d4313a227120ca36bd95683752a7879fAndrew Sapperstein    public static final int ATTACHMENT_SUPPORTS_DOWNLOAD_AGAIN_COLUMN = 10;
1974beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei    public static final int ATTACHMENT_TYPE_COLUMN = 11;
1975519c218db6109003ca72a35ffe276ed69b0230a4Martin Hibdon    public static final int ATTACHMENT_FLAGS_COLUMN = 12;
1976934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux    public static final int ATTACHMENT_CONTENT_ID_COLUMN = 13;
1977f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira
1978479505d71969e26b0785d8e0e1b81108731cf827Mark Wei    /** Separates attachment info parts in strings in the database. */
1979479505d71969e26b0785d8e0e1b81108731cf827Mark Wei    public static final String ATTACHMENT_INFO_SEPARATOR = "\n"; // use to join
1980479505d71969e26b0785d8e0e1b81108731cf827Mark Wei    public static final Pattern ATTACHMENT_INFO_SEPARATOR_PATTERN =
1981479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            Pattern.compile(ATTACHMENT_INFO_SEPARATOR); // use to split
1982479505d71969e26b0785d8e0e1b81108731cf827Mark Wei    public static final String ATTACHMENT_INFO_DELIMITER = "|"; // use to join
1983479505d71969e26b0785d8e0e1b81108731cf827Mark Wei    // use to split
1984479505d71969e26b0785d8e0e1b81108731cf827Mark Wei    public static final Pattern ATTACHMENT_INFO_DELIMITER_PATTERN = Pattern.compile("\\|");
1985479505d71969e26b0785d8e0e1b81108731cf827Mark Wei
1986e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang    /**
1987e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang     * Valid states for the {@link AttachmentColumns#STATE} column.
1988e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang     *
1989e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang     */
1990e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang    public static final class AttachmentState {
1991e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
1992e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * The full attachment is not present on device. When used as a command,
1993e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * setting this state will tell the provider to cancel a download in
1994e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * progress.
1995e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * <p>
1996f6fac0ae025efd7ad48675b2230a22cc7a8d6f74Mark Wei         * Valid next states: {@link #DOWNLOADING}, {@link #PAUSED}
1997e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
1998e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final int NOT_SAVED = 0;
1999e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2000e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * The most recent attachment download attempt failed. The current UI
2001e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * design does not require providers to persist this state, but
2002e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * providers must return this state at least once after a download
2003e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * failure occurs. This state may not be used as a command.
2004e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * <p>
2005e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * Valid next states: {@link #DOWNLOADING}
2006e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2007e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final int FAILED = 1;
2008e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2009e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * The attachment is currently being downloaded by the provider.
2010e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current
2011e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * download progress while in this state. When used as a command,
2012e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * setting this state will tell the provider to initiate a download to
2013e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * the accompanying destination in {@link AttachmentColumns#DESTINATION}
2014e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * .
2015e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * <p>
2016e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * Valid next states: {@link #NOT_SAVED}, {@link #FAILED},
2017e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * {@link #SAVED}
2018e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2019e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final int DOWNLOADING = 2;
2020e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2021e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * The attachment was successfully downloaded to the destination in
2022e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * {@link AttachmentColumns#DESTINATION}. If a provider later detects
2023e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * that a download is missing, it should reset the state to
2024e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * {@link #NOT_SAVED}. This state may not be used as a command on its
2025e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * own. To move a file from cache to external, update
2026e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * {@link AttachmentColumns#DESTINATION}.
2027e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * <p>
2028f6fac0ae025efd7ad48675b2230a22cc7a8d6f74Mark Wei         * Valid next states: {@link #NOT_SAVED}, {@link #PAUSED}
2029e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2030e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final int SAVED = 3;
203147ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei        /**
203247ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         * This is only used as a command, not as a state. The attachment is
203347ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         * currently being redownloaded by the provider.
203447ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current
203547ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         * download progress while in this state. When used as a command,
203647ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         * setting this state will tell the provider to initiate a download to
203747ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         * the accompanying destination in {@link AttachmentColumns#DESTINATION}
203847ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         * .
203947ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei         */
204047ca4e2a4c2d7387a7dd8d1925e2512acc553eabMark Wei        public static final int REDOWNLOADING = 4;
20417bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei        /**
20427bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei         * The attachment is either pending or paused in the download manager.
20437bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei         * {@link AttachmentColumns#DOWNLOADED_SIZE} should reflect the current
20447bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei         * download progress while in this state. This state may not be used as
20457bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei         * a command on its own.
20467bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei         * <p>
20477bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei         * Valid next states: {@link #DOWNLOADING}, {@link #FAILED}
20487bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei         */
20497bed4bc31a49a2297a38eb9d7b595fba1fa1f849Mark Wei        public static final int PAUSED = 5;
2050e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang
2051e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        private AttachmentState() {}
2052e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang    }
2053e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang
2054e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang    public static final class AttachmentDestination {
2055e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang
2056e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2057e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * The attachment will be or is already saved to the app-private cache partition.
2058e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2059e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final int CACHE = 0;
2060e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2061e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * The attachment will be or is already saved to external shared device storage.
20625b49ce377b9375d6e5a57ea699d324e8cca15a81Mark Wei         * This value should be 1 since saveToSd is often used in a similar way
2063e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2064e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final int EXTERNAL = 1;
2065e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang
2066e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        private AttachmentDestination() {}
2067e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang    }
2068e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang
2069f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    public static final class AttachmentColumns {
2070e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2071e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * This string column is the attachment's file name, intended for display in UI. It is not
2072e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * the full path of the file.
2073e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2074c97d8acdb45f9632129bd76b5b6f355f9cc57426Paul Westbrook        public static final String NAME = OpenableColumns.DISPLAY_NAME;
2075e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2076e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * This integer column is the file size of the attachment, in bytes.
2077e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2078c97d8acdb45f9632129bd76b5b6f355f9cc57426Paul Westbrook        public static final String SIZE = OpenableColumns.SIZE;
2079e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
20801aee17e324f204080baaabceb64f4edf73681542Mark Wei         * This column is a {@link android.net.Uri} that can be queried to
20811aee17e324f204080baaabceb64f4edf73681542Mark Wei         * monitor download state and progress for this individual attachment
20821aee17e324f204080baaabceb64f4edf73681542Mark Wei         * (resulting cursor has one single row for this attachment).
2083e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
20847a07fb4955e34250225287212b07d1b6f12bf671Mindy Pereira        public static final String URI = "uri";
2085e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2086e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * This string column is the MIME type of the attachment.
2087e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2088f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira        public static final String CONTENT_TYPE = "contentType";
2089e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2090e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * This integer column is the current downloading state of the
2091e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * attachment as defined in {@link AttachmentState}.
2092e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * <p>
2093d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         * Providers must accept updates to {@link #URI} with new values of
2094e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * this column to initiate or cancel downloads.
2095e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2096e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final String STATE = "state";
2097e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2098e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * This integer column is the file destination for the current download
2099e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * in progress (when {@link #STATE} is
2100e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * {@link AttachmentState#DOWNLOADING}) or the resulting downloaded file
2101e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * ( when {@link #STATE} is {@link AttachmentState#SAVED}), as defined
2102e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * in {@link AttachmentDestination}. This value is undefined in any
2103e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * other state.
2104e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * <p>
2105d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang         * Providers must accept updates to {@link #URI} with new values of
2106e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * this column to move an existing downloaded file.
2107e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2108e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final String DESTINATION = "destination";
2109e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
2110e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * This integer column is the current number of bytes downloaded when
2111e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * {@link #STATE} is {@link AttachmentState#DOWNLOADING}. This value is
2112e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         * undefined in any other state.
2113e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2114e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final String DOWNLOADED_SIZE = "downloadedSize";
2115e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
21161aee17e324f204080baaabceb64f4edf73681542Mark Wei         * This column is a {@link android.net.Uri} that points to the
21171aee17e324f204080baaabceb64f4edf73681542Mark Wei         * downloaded local file when {@link #STATE} is
21181aee17e324f204080baaabceb64f4edf73681542Mark Wei         * {@link AttachmentState#SAVED}. This value is undefined in any other
21191aee17e324f204080baaabceb64f4edf73681542Mark Wei         * state.
2120e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2121e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final String CONTENT_URI = "contentUri";
2122e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
21231aee17e324f204080baaabceb64f4edf73681542Mark Wei         * This column is a {@link android.net.Uri} that points to a local
21241aee17e324f204080baaabceb64f4edf73681542Mark Wei         * thumbnail file for the attachment. Providers that do not support
21251aee17e324f204080baaabceb64f4edf73681542Mark Wei         * downloading attachment thumbnails may leave this null.
2126e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2127e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        public static final String THUMBNAIL_URI = "thumbnailUri";
2128e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        /**
21291aee17e324f204080baaabceb64f4edf73681542Mark Wei         * This column is an {@link android.net.Uri} used in an
21301aee17e324f204080baaabceb64f4edf73681542Mark Wei         * {@link android.content.Intent#ACTION_VIEW} Intent to launch a preview
21311aee17e324f204080baaabceb64f4edf73681542Mark Wei         * activity that allows the user to efficiently view an attachment
21321aee17e324f204080baaabceb64f4edf73681542Mark Wei         * without having to first download the entire file. Providers that do
21331aee17e324f204080baaabceb64f4edf73681542Mark Wei         * not support previewing attachments may leave this null.
2134e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang         */
2135d49db8e3c4fff459f4ae3869ea80d083461eda2cPaul Westbrook        public static final String PREVIEW_INTENT_URI = "previewIntentUri";
2136bbe74aee04f669990e888095b0d6858dc1e17ce1Mark Wei        /**
2137bbe74aee04f669990e888095b0d6858dc1e17ce1Mark Wei         * This column contains provider-specific private data as JSON string.
2138bbe74aee04f669990e888095b0d6858dc1e17ce1Mark Wei         */
2139bbe74aee04f669990e888095b0d6858dc1e17ce1Mark Wei        public static final String PROVIDER_DATA = "providerData";
2140e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang
21417434e800d4313a227120ca36bd95683752a7879fAndrew Sapperstein        /**
2142beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei         * This column represents whether this attachment supports the ability to be downloaded
2143beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei         * again.
21447434e800d4313a227120ca36bd95683752a7879fAndrew Sapperstein         */
21457434e800d4313a227120ca36bd95683752a7879fAndrew Sapperstein        public static final String SUPPORTS_DOWNLOAD_AGAIN = "supportsDownloadAgain";
2146beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei        /**
2147beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei         * This column represents the visibility type of this attachment. One of the
2148beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei         * {@link AttachmentType} constants.
2149beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei         */
2150beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei        public static final String TYPE = "type";
21517434e800d4313a227120ca36bd95683752a7879fAndrew Sapperstein
2152519c218db6109003ca72a35ffe276ed69b0230a4Martin Hibdon        /**
2153519c218db6109003ca72a35ffe276ed69b0230a4Martin Hibdon         * This column holds various bitwise flags for status information.
2154519c218db6109003ca72a35ffe276ed69b0230a4Martin Hibdon         */
2155519c218db6109003ca72a35ffe276ed69b0230a4Martin Hibdon        public static final String FLAGS = "flags";
2156519c218db6109003ca72a35ffe276ed69b0230a4Martin Hibdon
2157934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux        /**
2158934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux         * This column holds the RFC 2392 content id of the email part for this attachment, if
2159934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux         * possible; otherwise it holds an identifier unique to the parent message.
2160934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux         */
2161934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux        public static final String CONTENT_ID = "contentId";
2162934b1f470a646a4ca64fc63eeb823d4c5c12698eJames Lemieux
2163e0b83b8d9d2e5930a9453173a8b1da63c57f6db7Andy Huang        private AttachmentColumns() {}
2164f30cc097db54007eac8d722aadf290540a139b0eMindy Pereira    }
2165013194caeba8848ba89a68c77843bed2bf7a38e5Mindy Pereira
21661aee17e324f204080baaabceb64f4edf73681542Mark Wei    public static final class AttachmentContentValueKeys {
21671aee17e324f204080baaabceb64f4edf73681542Mark Wei        public static final String RENDITION = "rendition";
2168267453587f13986acc7de3d52de95184c38fb4e1Mark Wei        public static final String ADDITIONAL_PRIORITY = "additionalPriority";
2169267453587f13986acc7de3d52de95184c38fb4e1Mark Wei        public static final String DELAY_DOWNLOAD = "delayDownload";
21701aee17e324f204080baaabceb64f4edf73681542Mark Wei    }
21711aee17e324f204080baaabceb64f4edf73681542Mark Wei
21721aee17e324f204080baaabceb64f4edf73681542Mark Wei    /**
21731aee17e324f204080baaabceb64f4edf73681542Mark Wei     * Indicates a version of an attachment.
21741aee17e324f204080baaabceb64f4edf73681542Mark Wei     */
21751aee17e324f204080baaabceb64f4edf73681542Mark Wei    public static final class AttachmentRendition {
21761aee17e324f204080baaabceb64f4edf73681542Mark Wei
21771aee17e324f204080baaabceb64f4edf73681542Mark Wei        /** A smaller or simpler version of the attachment, such as a scaled-down image or an HTML
21781aee17e324f204080baaabceb64f4edf73681542Mark Wei         * version of a document. Not always available.
21791aee17e324f204080baaabceb64f4edf73681542Mark Wei         */
21801aee17e324f204080baaabceb64f4edf73681542Mark Wei        public static final int SIMPLE = 0;
21811aee17e324f204080baaabceb64f4edf73681542Mark Wei        /**
21821aee17e324f204080baaabceb64f4edf73681542Mark Wei         * The full version of an attachment if it can be handled on the device, otherwise the
21831aee17e324f204080baaabceb64f4edf73681542Mark Wei         * preview.
21841aee17e324f204080baaabceb64f4edf73681542Mark Wei         */
21851aee17e324f204080baaabceb64f4edf73681542Mark Wei        public static final int BEST = 1;
21861aee17e324f204080baaabceb64f4edf73681542Mark Wei
21877df813e56ba3a8620e934bd462527a2467fcae52Mark Wei        private static final String SIMPLE_STRING = "SIMPLE";
21887df813e56ba3a8620e934bd462527a2467fcae52Mark Wei        private static final String BEST_STRING = "BEST";
21897df813e56ba3a8620e934bd462527a2467fcae52Mark Wei
2190479505d71969e26b0785d8e0e1b81108731cf827Mark Wei        /**
2191479505d71969e26b0785d8e0e1b81108731cf827Mark Wei         * Prefer renditions in this order.
2192479505d71969e26b0785d8e0e1b81108731cf827Mark Wei         */
2193479505d71969e26b0785d8e0e1b81108731cf827Mark Wei        public static final int[] PREFERRED_RENDITIONS = new int[]{BEST, SIMPLE};
2194479505d71969e26b0785d8e0e1b81108731cf827Mark Wei
21951aee17e324f204080baaabceb64f4edf73681542Mark Wei        public static int parseRendition(String rendition) {
2196479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            if (TextUtils.equals(rendition, SIMPLE_STRING)) {
2197479505d71969e26b0785d8e0e1b81108731cf827Mark Wei                return SIMPLE;
2198479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            } else if (TextUtils.equals(rendition, BEST_STRING)) {
2199479505d71969e26b0785d8e0e1b81108731cf827Mark Wei                return BEST;
2200479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            }
2201479505d71969e26b0785d8e0e1b81108731cf827Mark Wei
2202479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            throw new IllegalArgumentException(String.format("Unknown rendition %s", rendition));
22031aee17e324f204080baaabceb64f4edf73681542Mark Wei        }
22041aee17e324f204080baaabceb64f4edf73681542Mark Wei
22051aee17e324f204080baaabceb64f4edf73681542Mark Wei        public static String toString(int rendition) {
2206479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            if (rendition == BEST) {
2207479505d71969e26b0785d8e0e1b81108731cf827Mark Wei                return BEST_STRING;
2208479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            } else if (rendition == SIMPLE) {
2209479505d71969e26b0785d8e0e1b81108731cf827Mark Wei                return SIMPLE_STRING;
2210479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            }
2211479505d71969e26b0785d8e0e1b81108731cf827Mark Wei
2212479505d71969e26b0785d8e0e1b81108731cf827Mark Wei            throw new IllegalArgumentException(String.format("Unknown rendition %d", rendition));
22131aee17e324f204080baaabceb64f4edf73681542Mark Wei        }
22141aee17e324f204080baaabceb64f4edf73681542Mark Wei    }
22151aee17e324f204080baaabceb64f4edf73681542Mark Wei
2216beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei    /**
2217beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei     * Indicates the visibility type of an attachment.
2218beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei     */
2219beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei    public static final class AttachmentType {
2220beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei        public static final int STANDARD = 0;
2221beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei        public static final int INLINE_CURRENT_MESSAGE = 1;
2222beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei        public static final int INLINE_QUOTED_MESSAGE = 2;
2223beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei    }
2224beaf1e4d14f89e7735ba94a0b2ff92233c6f928fMark Wei
2225b31ab5aea601f8aa5136a99edc23fb4d907f792eMarc Blank    public static final String[] UNDO_PROJECTION = {
2226b31ab5aea601f8aa5136a99edc23fb4d907f792eMarc Blank        ConversationColumns.MESSAGE_LIST_URI
2227b31ab5aea601f8aa5136a99edc23fb4d907f792eMarc Blank    };
2228b31ab5aea601f8aa5136a99edc23fb4d907f792eMarc Blank    public static final int UNDO_MESSAGE_LIST_COLUMN = 0;
2229dd10bc8736282262da0cd9a5f9a0236c10b47028Marc Blank
2230dd10bc8736282262da0cd9a5f9a0236c10b47028Marc Blank    // Parameter used to indicate the sequence number for an undoable operation
2231dd10bc8736282262da0cd9a5f9a0236c10b47028Marc Blank    public static final String SEQUENCE_QUERY_PARAMETER = "seq";
223263eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook
22331007e70b1abad47c84d19890809e2b3727419607Scott Kennedy    /**
22341007e70b1abad47c84d19890809e2b3727419607Scott Kennedy     * Parameter used to force UI notifications in an operation involving
22351007e70b1abad47c84d19890809e2b3727419607Scott Kennedy     * {@link ConversationOperations#OPERATION_KEY}.
22361007e70b1abad47c84d19890809e2b3727419607Scott Kennedy     */
22371007e70b1abad47c84d19890809e2b3727419607Scott Kennedy    public static final String FORCE_UI_NOTIFICATIONS_QUERY_PARAMETER = "forceUiNotifications";
22381007e70b1abad47c84d19890809e2b3727419607Scott Kennedy
2239dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy    /**
2240dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy     * Parameter used to allow returning hidden folders.
2241dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy     */
2242dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy    public static final String ALLOW_HIDDEN_FOLDERS_QUERY_PARAM = "allowHiddenFolders";
2243dd2ec688cf18e0ec132d936168ccaa3c43cdefb1Scott Kennedy
22440d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy    public static final String AUTO_ADVANCE_MODE_OLDER = "older";
22450d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy    public static final String AUTO_ADVANCE_MODE_NEWER = "newer";
22460d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy    public static final String AUTO_ADVANCE_MODE_LIST = "list";
22470d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy
2248c7694221dfa5cec3f4ae290f2266b081b2639d80Vikram Aggarwal    /**
2249c7694221dfa5cec3f4ae290f2266b081b2639d80Vikram Aggarwal     * Settings for auto advancing when the current conversation has been destroyed.
2250c7694221dfa5cec3f4ae290f2266b081b2639d80Vikram Aggarwal     */
225163eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook    public static final class AutoAdvance {
2252c7694221dfa5cec3f4ae290f2266b081b2639d80Vikram Aggarwal        /** No setting specified. */
225363eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int UNSET = 0;
2254c7694221dfa5cec3f4ae290f2266b081b2639d80Vikram Aggarwal        /** Go to the older message (if available) */
225563eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int OLDER = 1;
2256c7694221dfa5cec3f4ae290f2266b081b2639d80Vikram Aggarwal        /** Go to the newer message (if available) */
225763eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int NEWER = 2;
2258c7694221dfa5cec3f4ae290f2266b081b2639d80Vikram Aggarwal        /** Go back to conversation list*/
225963eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int LIST = 3;
226082d37501827cf9770ba4610dd6f81c7a3a14b2e1Vikram Aggarwal        /** The default option is to go to the list */
226182d37501827cf9770ba4610dd6f81c7a3a14b2e1Vikram Aggarwal        public static final int DEFAULT = LIST;
22620d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy
22630d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy        /**
22640d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         * Gets the int value for the given auto advance setting.
22650d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         *
22660d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         * @param autoAdvanceSetting The string setting, such as "newer", "older", "list"
22670d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy         */
22680d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy        public static int getAutoAdvanceInt(final String autoAdvanceSetting) {
22690d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy            final int autoAdvance;
22700d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy
22710d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy            if (AUTO_ADVANCE_MODE_NEWER.equals(autoAdvanceSetting)) {
2272e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                autoAdvance = NEWER;
22730d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy            } else if (AUTO_ADVANCE_MODE_OLDER.equals(autoAdvanceSetting)) {
2274e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                autoAdvance = OLDER;
22750d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy            } else if (AUTO_ADVANCE_MODE_LIST.equals(autoAdvanceSetting)) {
2276e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                autoAdvance = LIST;
22770d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy            } else {
2278e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                autoAdvance = UNSET;
22790d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy            }
22800d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy
22810d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy            return autoAdvance;
22820d0f8b061faae060529af4da339eed2d728ef1bdScott Kennedy        }
2283e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang
2284e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang        public static String getAutoAdvanceStr(int autoAdvance) {
2285e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang            final String str;
2286e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang
2287e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang            switch (autoAdvance) {
2288e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                case OLDER:
2289e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    str = AUTO_ADVANCE_MODE_OLDER;
2290e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    break;
2291e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                case NEWER:
2292e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    str = AUTO_ADVANCE_MODE_NEWER;
2293e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    break;
2294e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                case LIST:
2295e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    str = AUTO_ADVANCE_MODE_LIST;
2296e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    break;
2297e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                default:
2298e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    str = "unset";
2299e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang                    break;
2300e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang            }
2301e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang
2302e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang            return str;
2303e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang        }
230463eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook    }
230563eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook
230671a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira    /**
230771a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira     * Settings for what swipe should do.
230871a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira     */
230971a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira    public static final class Swipe {
231071a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira        /** Archive or remove label, if available. */
231171a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira        public static final int ARCHIVE = 0;
231271a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira        /** Delete */
231371a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira        public static final int DELETE = 1;
231471a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira        /** No swipe */
231571a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira        public static final int DISABLED = 2;
2316e58222b9421756e11eb24799c1785a090d0793adMindy Pereira        /** Default is delete */
23171c605fec244bf7175b5a9115bde01b28fd6cfe74Mindy Pereira        public static final int DEFAULT = ARCHIVE;
231871a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira    }
231971a8f5e5d2bb6b2a34460ef4c11db0311054334eMindy Pereira
2320fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook    /**
2321fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook     * Settings for Conversation view mode.
2322fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook     */
2323fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook    public static final class ConversationViewMode {
2324fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook        /**
2325fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook         * The user hasn't specified a mode.
2326fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook         */
2327fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook        public static final int UNDEFINED = -1;
2328fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook        /**
2329fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook         * Default to fit the conversation to screen view
2330fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook         */
2331fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook        public static final int OVERVIEW = 0;
2332fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook        /**
2333fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook         * Conversation text size should be the device default, and wide conversations may
2334fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook         * require panning
2335fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook         */
2336fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook        public static final int READING = 1;
2337ccf6780d9c80070beca4ade6e4084c3fb719af51Andy Huang        public static final int DEFAULT = OVERVIEW;
2338fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook    }
2339fa255c019a8d4f6a74cc544a4dd2d8b74b1fc572Paul Westbrook
234063eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook    public static final class SnapHeaderValue {
234163eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int ALWAYS = 0;
234263eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int PORTRAIT_ONLY = 1;
234363eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int NEVER = 2;
234463eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook    }
234563eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook
234663eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook    public static final class DefaultReplyBehavior {
234763eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int REPLY = 0;
234863eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook        public static final int REPLY_ALL = 1;
234963eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook    }
235063eef79f2fb114a6026349eccf3fac6134b76e65Paul Westbrook
2351ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook    /**
23524758e980c21027ef1a9cacc9847170290b2ae42eAlice Yang     * Setting for whether to show sender images in conversation list.
2353642731419abb9037a729114d32d6ddd15af0a406Alice Yang     */
2354642731419abb9037a729114d32d6ddd15af0a406Alice Yang    public static final class ConversationListIcon {
2355642731419abb9037a729114d32d6ddd15af0a406Alice Yang        public static final int SENDER_IMAGE = 1;
2356642731419abb9037a729114d32d6ddd15af0a406Alice Yang        public static final int NONE = 2;
2357f5ffaee65c96bdb71d4a33393fd2b95c7cf951a6Alice Yang        public static final int DEFAULT = 1; // Default to show sender image
2358642731419abb9037a729114d32d6ddd15af0a406Alice Yang    }
2359642731419abb9037a729114d32d6ddd15af0a406Alice Yang
2360642731419abb9037a729114d32d6ddd15af0a406Alice Yang    /**
2361bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank     * Action for an intent used to update/create new notifications.  The mime type of this
2362ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook     * intent should be set to the mimeType of the account that is generating this notification.
2363ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook     * An intent of this action is required to have the following extras:
2364d8e249ee7abb0e1ad24e17e4e299736d4a150936Andy Huang     * {@link UpdateNotificationExtras#EXTRA_FOLDER} {@link UpdateNotificationExtras#EXTRA_ACCOUNT}
2365ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook     */
2366ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook    public static final String ACTION_UPDATE_NOTIFICATION =
2367ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook            "com.android.mail.action.update_notification";
2368ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook
2369bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank    public static final class UpdateNotificationExtras {
2370bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank        /**
23716ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook         * Parcelable extra containing a {@link Uri} to a {@link Folder}
2372bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank         */
2373bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank        public static final String EXTRA_FOLDER = "notification_extra_folder";
2374ee0fda7a88dd13cf51e1526eb029520672f318ebPaul Westbrook
2375bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank        /**
23766ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook         * Parcelable extra containing a {@link Uri} to an {@link Account}
2377bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank         */
2378bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank        public static final String EXTRA_ACCOUNT = "notification_extra_account";
23796ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook
23806ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook        /**
23816ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook         * Integer extra containing the update unread count for the account/folder.
23826ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook         * If this value is 0, the UI will not block the intent to allow code to clear notifications
23836ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook         * to run.
23846ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook         */
23856ead20dd9643e6435d6c1111f99c520870812ea8Paul Westbrook        public static final String EXTRA_UPDATED_UNREAD_COUNT = "notification_updated_unread_count";
238681d005677a97263f92928032d47cbc5ef5fbcb88Tony Mantler
238781d005677a97263f92928032d47cbc5ef5fbcb88Tony Mantler        /**
238881d005677a97263f92928032d47cbc5ef5fbcb88Tony Mantler         * Integer extra containing the update unseen count for the account/folder.
238981d005677a97263f92928032d47cbc5ef5fbcb88Tony Mantler         */
239081d005677a97263f92928032d47cbc5ef5fbcb88Tony Mantler        public static final String EXTRA_UPDATED_UNSEEN_COUNT = "notification_updated_unseen_count";
2391bc6ba05fea3057d5323f1939904a10cc391945fcMarc Blank    }
2392e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook
2393e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook    public static final class EditSettingsExtras {
2394e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook        /**
2395e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         * Parcelable extra containing account for which the user wants to
2396e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         * modify settings
2397e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         */
2398e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook        public static final String EXTRA_ACCOUNT = "extra_account";
2399e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook
2400e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook        /**
2401e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         * Parcelable extra containing folder for which the user wants to
2402e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         * modify settings
2403e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook         */
2404e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook        public static final String EXTRA_FOLDER = "extra_folder";
240518babd2334a0c3dfdcb3519299e4dcbd781c8c2dPaul Westbrook
240618babd2334a0c3dfdcb3519299e4dcbd781c8c2dPaul Westbrook        /**
240718babd2334a0c3dfdcb3519299e4dcbd781c8c2dPaul Westbrook         * Boolean extra which is set true if the user wants to "manage folders"
240818babd2334a0c3dfdcb3519299e4dcbd781c8c2dPaul Westbrook         */
240918babd2334a0c3dfdcb3519299e4dcbd781c8c2dPaul Westbrook        public static final String EXTRA_MANAGE_FOLDERS = "extra_manage_folders";
2410e550355f79eed5b133c80b88b332de50dcad8697Paul Westbrook    }
241117beb0b8aee78a39a2094a48ba7f55a602f701cbPaul Westbrook
241217beb0b8aee78a39a2094a48ba7f55a602f701cbPaul Westbrook    public static final class SendFeedbackExtras {
241317beb0b8aee78a39a2094a48ba7f55a602f701cbPaul Westbrook        /**
241417beb0b8aee78a39a2094a48ba7f55a602f701cbPaul Westbrook         * Optional boolean extras which indicates that the user is reporting a problem.
241517beb0b8aee78a39a2094a48ba7f55a602f701cbPaul Westbrook         */
241617beb0b8aee78a39a2094a48ba7f55a602f701cbPaul Westbrook        public static final String EXTRA_REPORTING_PROBLEM = "reporting_problem";
241783e6b574cffd06164cad18ee388237a9427ceb3fPaul Westbrook        /**
241883e6b574cffd06164cad18ee388237a9427ceb3fPaul Westbrook         * Optional Parcelable extra containing the screenshot of the screen where the user
241983e6b574cffd06164cad18ee388237a9427ceb3fPaul Westbrook         * is reporting a problem.
242083e6b574cffd06164cad18ee388237a9427ceb3fPaul Westbrook         */
242183e6b574cffd06164cad18ee388237a9427ceb3fPaul Westbrook        public static final String EXTRA_SCREEN_SHOT = "screen_shot";
242217beb0b8aee78a39a2094a48ba7f55a602f701cbPaul Westbrook    }
24239982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei
24249982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei    public static final class ViewProxyExtras {
24259982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        /**
24269982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         * Uri extra passed to the proxy which indicates the original Uri that was intended to be
24279982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         * viewed.
24289982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         */
24299982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        public static final String EXTRA_ORIGINAL_URI = "original_uri";
24309982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        /**
243165f252ae98f9fb9e19d559af39a33eb0bedd2aa6Andrew Sapperstein         * String extra passed to the proxy which indicates the account being viewed.
24329982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         */
243365f252ae98f9fb9e19d559af39a33eb0bedd2aa6Andrew Sapperstein        public static final String EXTRA_ACCOUNT_NAME = "account_name";
24349982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        /**
24359982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         * String extra passed from the proxy which indicates the salt used to generate the digest.
24369982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         */
24379982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        public static final String EXTRA_SALT = "salt";
24389982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        /**
24399982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         * Byte[] extra passed from the proxy which indicates the digest of the salted account name.
24409982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei         */
24419982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei        public static final String EXTRA_ACCOUNT_DIGEST = "digest";
24429982fdb413d09b8e391dbc96a114987b1b87bb62Mark Wei    }
244382ea6da7fe2bbb76b2c2caf06a9d0ee07e456363Paul Westbrook}
2444