ContactsContract.java revision ef348c757d79e1751329db6746dbf846bdea6fc9
1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16
17package android.provider;
18
19import android.content.Intent;
20import android.content.ContentProviderClient;
21import android.content.ContentProviderOperation;
22import android.content.res.Resources;
23import android.graphics.BitmapFactory;
24import android.net.Uri;
25import android.provider.ContactsContract.CommonDataKinds.GroupMembership;
26import android.accounts.Account;
27import android.os.RemoteException;
28
29/**
30 * The contract between the contacts provider and applications. Contains definitions
31 * for the supported URIs and columns.
32 *
33 * @hide
34 */
35public final class ContactsContract {
36    /** The authority for the contacts provider */
37    public static final String AUTHORITY = "com.android.contacts";
38    /** A content:// style uri to the authority for the contacts provider */
39    public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);
40
41    public interface SyncStateColumns extends SyncStateContract.Columns {
42    }
43
44    public static final class SyncState {
45        /**
46         * This utility class cannot be instantiated
47         */
48        private SyncState() {}
49
50        public static final String CONTENT_DIRECTORY =
51                SyncStateContract.Constants.CONTENT_DIRECTORY;
52
53        /**
54         * The content:// style URI for this table
55         */
56        public static final Uri CONTENT_URI =
57                Uri.withAppendedPath(AUTHORITY_URI, CONTENT_DIRECTORY);
58
59        /**
60         * @see android.provider.SyncStateContract.Helpers#get
61         */
62        public static byte[] get(ContentProviderClient provider, Account account)
63                throws RemoteException {
64            return SyncStateContract.Helpers.get(provider, CONTENT_URI, account);
65        }
66
67        /**
68         * @see android.provider.SyncStateContract.Helpers#set
69         */
70        public static void set(ContentProviderClient provider, Account account, byte[] data)
71                throws RemoteException {
72            SyncStateContract.Helpers.set(provider, CONTENT_URI, account, data);
73        }
74
75        /**
76         * @see android.provider.SyncStateContract.Helpers#newSetOperation
77         */
78        public static ContentProviderOperation newSetOperation(Account account, byte[] data) {
79            return SyncStateContract.Helpers.newSetOperation(CONTENT_URI, account, data);
80        }
81    }
82
83    public interface ContactOptionsColumns {
84        /**
85         * The number of times a person has been contacted
86         * <P>Type: INTEGER</P>
87         */
88        public static final String TIMES_CONTACTED = "times_contacted";
89
90        /**
91         * The last time a person was contacted.
92         * <P>Type: INTEGER</P>
93         */
94        public static final String LAST_TIME_CONTACTED = "last_time_contacted";
95
96        /**
97         * Is the contact starred?
98         * <P>Type: INTEGER (boolean)</P>
99         */
100        public static final String STARRED = "starred";
101
102        /**
103         * A custom ringtone associated with a person. Not always present.
104         * <P>Type: TEXT (URI to the ringtone)</P>
105         */
106        public static final String CUSTOM_RINGTONE = "custom_ringtone";
107
108        /**
109         * Whether the person should always be sent to voicemail. Not always
110         * present.
111         * <P>Type: INTEGER (0 for false, 1 for true)</P>
112         */
113        public static final String SEND_TO_VOICEMAIL = "send_to_voicemail";
114    }
115
116    private interface AggregatesColumns {
117        /**
118         * The display name for the contact.
119         * <P>Type: TEXT</P>
120         */
121        public static final String DISPLAY_NAME = "display_name";
122
123        /**
124         * Reference to the row in the data table holding the primary phone number.
125         * <P>Type: INTEGER REFERENCES data(_id)</P>
126         */
127        public static final String PRIMARY_PHONE_ID = "primary_phone_id";
128
129        /**
130         * Reference to the row in the data table holding the primary email address.
131         * <P>Type: INTEGER REFERENCES data(_id)</P>
132         */
133        public static final String PRIMARY_EMAIL_ID = "primary_email_id";
134
135        /**
136         * Reference to the row in the data table holding the photo.
137         * <P>Type: INTEGER REFERENCES data(_id)</P>
138         */
139        public static final String PHOTO_ID = "photo_id";
140
141        /**
142         * Lookup value that reflects the {@link Groups#GROUP_VISIBLE} state of
143         * any {@link GroupMembership} for this aggregate.
144         */
145        public static final String IN_VISIBLE_GROUP = "in_visible_group";
146
147        /**
148         * Contact presence status.  See {@link android.provider.Im.CommonPresenceColumns}
149         * for individual status definitions.
150         */
151        public static final String PRESENCE_STATUS = Presence.PRESENCE_STATUS;
152
153        /**
154         * The type of data, for example Home or Work.
155         * <P>Type: INTEGER</P>
156         */
157        public static final String PRIMARY_PHONE_TYPE = CommonDataKinds.Phone.TYPE;
158
159        /**
160         * The user defined label for the primary phone.
161         * <P>Type: TEXT</P>
162         */
163        public static final String PRIMARY_PHONE_LABEL = CommonDataKinds.Phone.LABEL;
164
165        /**
166         * The primary phone number.
167         * <P>Type: TEXT</P>
168         */
169        public static final String PRIMARY_PHONE_NUMBER = CommonDataKinds.Phone.NUMBER;
170    }
171
172
173    /**
174     * Constants for the aggregates table, which contains a record per group
175     * of contact representing the same person.
176     */
177    public static final class Aggregates implements BaseColumns, AggregatesColumns,
178            ContactOptionsColumns {
179        /**
180         * This utility class cannot be instantiated
181         */
182        private Aggregates()  {}
183
184        /**
185         * The content:// style URI for this table
186         */
187        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "aggregates");
188
189        /**
190         * The content:// style URI for this table joined with useful data from
191         * {@link Data}.
192         */
193        public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI,
194                "aggregates_summary");
195
196        /**
197         * The content:// style URI used for "type-to-filter" functionality on the
198         * {@link #CONTENT_SUMMARY_URI} URI. The filter string will be used to match
199         * various parts of the aggregate name. The filter argument should be passed
200         * as an additional path segment after this URI.
201         */
202        public static final Uri CONTENT_SUMMARY_FILTER_URI = Uri.withAppendedPath(
203                CONTENT_SUMMARY_URI, "filter");
204
205        /**
206         * The content:// style URI for this table joined with useful data from
207         * {@link Data}, filtered to include only starred aggregates
208         * and the most frequently contacted aggregates.
209         */
210        public static final Uri CONTENT_SUMMARY_STREQUENT_URI = Uri.withAppendedPath(
211                CONTENT_SUMMARY_URI, "strequent");
212
213        /**
214         * The content:// style URI used for "type-to-filter" functionality on the
215         * {@link #CONTENT_SUMMARY_STREQUENT_URI} URI. The filter string will be used to match
216         * various parts of the aggregate name. The filter argument should be passed
217         * as an additional path segment after this URI.
218         */
219        public static final Uri CONTENT_SUMMARY_STREQUENT_FILTER_URI = Uri.withAppendedPath(
220                CONTENT_SUMMARY_STREQUENT_URI, "filter");
221
222        public static final Uri CONTENT_SUMMARY_GROUP_URI = Uri.withAppendedPath(
223                CONTENT_SUMMARY_URI, "group");
224        /**
225         * The MIME type of {@link #CONTENT_URI} providing a directory of
226         * people.
227         */
228        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/person_aggregate";
229
230        /**
231         * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
232         * person.
233         */
234        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/person_aggregate";
235
236        /**
237         * A sub-directory of a single contact aggregate that contains all of their
238         * {@link Data} rows.
239         */
240        public static final class Data implements BaseColumns, DataColumns {
241            /**
242             * no public constructor since this is a utility class
243             */
244            private Data() {}
245
246            /**
247             * The directory twig for this sub-table
248             */
249            public static final String CONTENT_DIRECTORY = "data";
250        }
251
252        /**
253         * A sub-directory of a single contact aggregate that contains all aggregation suggestions
254         * (other aggregates).  The aggregation suggestions are computed based on approximate
255         * data matches with this aggregate.
256         */
257        public static final class AggregationSuggestions implements BaseColumns, AggregatesColumns {
258            /**
259             * No public constructor since this is a utility class
260             */
261            private AggregationSuggestions() {}
262
263            /**
264             * The directory twig for this sub-table
265             */
266            public static final String CONTENT_DIRECTORY = "suggestions";
267
268            /**
269             * An optional query parameter that can be supplied to limit the number of returned
270             * suggestions.
271             * <p>
272             * Type: INTEGER
273             */
274            public static final String MAX_SUGGESTIONS = "max_suggestions";
275        }
276    }
277
278    /**
279     * Columns that appear when each row of a table belongs to a specific
280     * account, including sync information that an account may need.
281     */
282    private interface SyncColumns {
283        /**
284         * The name of the account instance to which this row belongs.
285         * <P>Type: TEXT</P>
286         */
287        public static final String ACCOUNT_NAME = "account_name";
288
289        /**
290         * The type of account to which this row belongs, which when paired with
291         * {@link #ACCOUNT_NAME} identifies a specific account.
292         * <P>Type: TEXT</P>
293         */
294        public static final String ACCOUNT_TYPE = "account_type";
295
296        /**
297         * String that uniquely identifies this row to its source account.
298         * <P>Type: TEXT</P>
299         */
300        public static final String SOURCE_ID = "sourceid";
301
302        /**
303         * Version number that is updated whenever this row or its related data
304         * changes.
305         * <P>Type: INTEGER</P>
306         */
307        public static final String VERSION = "version";
308
309        /**
310         * Flag indicating that {@link #VERSION} has changed, and this row needs
311         * to be synchronized by its owning account.
312         * <P>Type: INTEGER (boolean)</P>
313         */
314        public static final String DIRTY = "dirty";
315
316    }
317
318    private interface ContactsColumns {
319        /**
320         * A reference to the {@link Aggregates#_ID} that this data belongs to.
321         * <P>Type: INTEGER</P>
322         */
323        public static final String AGGREGATE_ID = "aggregate_id";
324
325        /**
326         * Flag indicating that this {@link Contacts} entry and its children has
327         * been restricted to specific platform apps.
328         * <P>Type: INTEGER (boolean)</P>
329         *
330         * @hide until finalized in future platform release
331         */
332        public static final String IS_RESTRICTED = "is_restricted";
333
334        /**
335         * The aggregation mode for this contact.
336         * <P>Type: INTEGER</P>
337         */
338        public static final String AGGREGATION_MODE = "aggregation_mode";
339    }
340
341    /**
342     * Constants for the contacts table, which contains the base contact information.
343     */
344    public static final class Contacts implements BaseColumns, ContactsColumns, SyncColumns,
345            ContactOptionsColumns {
346        /**
347         * This utility class cannot be instantiated
348         */
349        private Contacts() {
350        }
351
352        /**
353         * The content:// style URI for this table
354         */
355        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "contacts");
356
357        /**
358         * The content:// style URL for filtering people by email address. The
359         * filter argument should be passed as an additional path segment after
360         * this URI.
361         *
362         * @hide
363         */
364        public static final Uri CONTENT_FILTER_EMAIL_URI =
365                Uri.withAppendedPath(CONTENT_URI, "filter_email");
366
367        /**
368         * The MIME type of {@link #CONTENT_URI} providing a directory of
369         * people.
370         */
371        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/person";
372
373        /**
374         * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
375         * person.
376         */
377        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/person";
378
379        /**
380         * Aggregation mode: aggregate asynchronously.
381         */
382        public static final int AGGREGATION_MODE_DEFAULT = 0;
383
384        /**
385         * Aggregation mode: aggregate at the time the contact is inserted/updated.
386         */
387        public static final int AGGREGATION_MODE_IMMEDITATE = 1;
388
389        /**
390         * Aggregation mode: never aggregate this contact (note that the contact will not
391         * have a corresponding Aggregate and therefore will not be included in Aggregates
392         * query results.)
393         */
394        public static final int AGGREGATION_MODE_DISABLED = 2;
395
396        /**
397         * A sub-directory of a single contact that contains all of their {@link Data} rows.
398         * To access this directory append
399         */
400        public static final class Data implements BaseColumns, DataColumns {
401            /**
402             * no public constructor since this is a utility class
403             */
404            private Data() {
405            }
406
407            /**
408             * The directory twig for this sub-table
409             */
410            public static final String CONTENT_DIRECTORY = "data";
411        }
412    }
413
414    private interface DataColumns {
415        /**
416         * The package name to use when creating {@link Resources} objects for
417         * this data row. This value is only designed for use when building user
418         * interfaces, and should not be used to infer the owner.
419         */
420        public static final String RES_PACKAGE = "res_package";
421
422        /**
423         * The MIME type of the item represented by this row.
424         */
425        public static final String MIMETYPE = "mimetype";
426
427        /**
428         * A reference to the {@link android.provider.ContactsContract.Contacts#_ID}
429         * that this data belongs to.
430         */
431        public static final String CONTACT_ID = "contact_id";
432
433        /**
434         * Whether this is the primary entry of its kind for the contact it belongs to
435         * <P>Type: INTEGER (if set, non-0 means true)</P>
436         */
437        public static final String IS_PRIMARY = "is_primary";
438
439        /**
440         * Whether this is the primary entry of its kind for the aggregate it belongs to. Any data
441         * record that is "super primary" must also be "primary".
442         * <P>Type: INTEGER (if set, non-0 means true)</P>
443         */
444        public static final String IS_SUPER_PRIMARY = "is_super_primary";
445
446        /**
447         * The version of this data record. This is a read-only value. The data column is
448         * guaranteed to not change without the version going up. This value is monotonically
449         * increasing.
450         * <P>Type: INTEGER</P>
451         */
452        public static final String DATA_VERSION = "data_version";
453
454        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
455        public static final String DATA1 = "data1";
456        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
457        public static final String DATA2 = "data2";
458        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
459        public static final String DATA3 = "data3";
460        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
461        public static final String DATA4 = "data4";
462        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
463        public static final String DATA5 = "data5";
464        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
465        public static final String DATA6 = "data6";
466        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
467        public static final String DATA7 = "data7";
468        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
469        public static final String DATA8 = "data8";
470        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
471        public static final String DATA9 = "data9";
472        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
473        public static final String DATA10 = "data10";
474        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
475        public static final String DATA11 = "data11";
476        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
477        public static final String DATA12 = "data12";
478        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
479        public static final String DATA13 = "data13";
480        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
481        public static final String DATA14 = "data14";
482        /** Generic data column, the meaning is {@link #MIMETYPE} specific */
483        public static final String DATA15 = "data15";
484    }
485
486    /**
487     * Constants for the data table, which contains data points tied to a contact.
488     * For example, a phone number or email address. Each row in this table contains a type
489     * definition and some generic columns. Each data type can define the meaning for each of
490     * the generic columns.
491     */
492    public static final class Data implements BaseColumns, DataColumns {
493        /**
494         * This utility class cannot be instantiated
495         */
496        private Data() {}
497
498        /**
499         * The content:// style URI for this table
500         */
501        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "data");
502
503        /**
504         * The MIME type of {@link #CONTENT_URI} providing a directory of data.
505         */
506        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/data";
507    }
508
509    /**
510     * A table that represents the result of looking up a phone number, for
511     * example for caller ID. The table joins that data row for the phone number
512     * with the contact that owns the number. To perform a lookup you must
513     * append the number you want to find to {@link #CONTENT_FILTER_URI}.
514     */
515    public static final class PhoneLookup implements BaseColumns, DataColumns, AggregatesColumns {
516        /**
517         * This utility class cannot be instantiated
518         */
519        private PhoneLookup() {}
520
521        /**
522         * The content:// style URI for this table. Append the phone number you want to lookup
523         * to this URI and query it to perform a lookup. For example:
524         *
525         * {@code
526         * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_URI, phoneNumber);
527         * }
528         */
529        public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(AUTHORITY_URI,
530                "phone_lookup");
531    }
532
533    /**
534     * Additional data mixed in with {@link Im.CommonPresenceColumns} to link
535     * back to specific {@link ContactsContract.Aggregates#_ID} entries.
536     */
537    private interface PresenceColumns {
538
539        /**
540         * The unique ID for a row.
541         * <P>Type: INTEGER (long)</P>
542         */
543        public static final String _ID = "presence_id";
544
545        /**
546         * Reference to the {@link android.provider.ContactsContract.Contacts#_ID} this presence
547         * references.
548         * <P>Type: INTEGER</P>
549         */
550        public static final String CONTACT_ID = "contact_id";
551
552        /**
553         * Reference to the {@link Data#_ID} entry that owns this presence.
554         * <P>Type: INTEGER</P>
555         */
556        public static final String DATA_ID = "data_id";
557
558        /**
559         * The IM service the presence is coming from. Formatted using either
560         * {@link CommonDataKinds.Im#encodePredefinedImProtocol(int)} or
561         * {@link CommonDataKinds.Im#encodeCustomImProtocol(String)}.
562         * <P>Type: TEXT</P>
563         */
564        public static final String IM_PROTOCOL = "im_protocol";
565
566        /**
567         * The IM handle the presence item is for. The handle is scoped to the
568         * {@link #IM_PROTOCOL}.
569         * <P>Type: TEXT</P>
570         */
571        public static final String IM_HANDLE = "im_handle";
572
573        /**
574         * The IM account for the local user that the presence data came from.
575         * <P>Type: TEXT</P>
576         */
577        public static final String IM_ACCOUNT = "im_account";
578    }
579
580    public static final class Presence implements PresenceColumns, Im.CommonPresenceColumns {
581        /**
582         * This utility class cannot be instantiated
583         */
584        private Presence() {
585        }
586
587        /**
588         * The content:// style URI for this table
589         */
590        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "presence");
591
592        /**
593         * Gets the resource ID for the proper presence icon.
594         *
595         * @param status the status to get the icon for
596         * @return the resource ID for the proper presence icon
597         */
598        public static final int getPresenceIconResourceId(int status) {
599            switch (status) {
600                case AVAILABLE:
601                    return android.R.drawable.presence_online;
602                case IDLE:
603                case AWAY:
604                    return android.R.drawable.presence_away;
605                case DO_NOT_DISTURB:
606                    return android.R.drawable.presence_busy;
607                case INVISIBLE:
608                    return android.R.drawable.presence_invisible;
609                case OFFLINE:
610                default:
611                    return android.R.drawable.presence_offline;
612            }
613        }
614
615        /**
616         * Returns the precedence of the status code the higher number being the higher precedence.
617         *
618         * @param status The status code.
619         * @return An integer representing the precedence, 0 being the lowest.
620         */
621        public static final int getPresencePrecedence(int status) {
622            // Keep this function here incase we want to enforce a different precedence than the
623            // natural order of the status constants.
624            return status;
625        }
626
627        /**
628         * The MIME type of {@link #CONTENT_URI} providing a directory of
629         * presence details.
630         */
631        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/im-presence";
632
633        /**
634         * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
635         * presence detail.
636         */
637        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im-presence";
638    }
639
640    /**
641     * Container for definitions of common data types stored in the {@link Data} table.
642     */
643    public static final class CommonDataKinds {
644        /**
645         * The {@link Data#RES_PACKAGE} value for common data that should be
646         * shown using a default style.
647         */
648        public static final String PACKAGE_COMMON = "common";
649
650        /**
651         * Columns common across the specific types.
652         */
653        private interface BaseCommonColumns {
654            /**
655             * The package name to use when creating {@link Resources} objects for
656             * this data row. This value is only designed for use when building user
657             * interfaces, and should not be used to infer the owner.
658             */
659            public static final String RES_PACKAGE = "res_package";
660
661            /**
662             * The MIME type of the item represented by this row.
663             */
664            public static final String MIMETYPE = "mimetype";
665
666            /**
667             * The {@link Contacts#_ID} that this data belongs to.
668             */
669            public static final String CONTACT_ID = "contact_id";
670        }
671
672        /**
673         * The base types that all "Typed" data kinds support.
674         */
675        public interface BaseTypes {
676
677            /**
678             * A custom type. The custom label should be supplied by user.
679             */
680            public static int TYPE_CUSTOM = 0;
681        }
682
683        /**
684         * Columns common across the specific types.
685         */
686        private interface CommonColumns extends BaseTypes{
687            /**
688             * The type of data, for example Home or Work.
689             * <P>Type: INTEGER</P>
690             */
691            public static final String TYPE = "data1";
692
693            /**
694             * The data for the contact method.
695             * <P>Type: TEXT</P>
696             */
697            public static final String DATA = "data2";
698
699            /**
700             * The user defined label for the the contact method.
701             * <P>Type: TEXT</P>
702             */
703            public static final String LABEL = "data3";
704        }
705
706        /**
707         * Parts of the name.
708         */
709        public static final class StructuredName implements BaseCommonColumns {
710            private StructuredName() {}
711
712            /** MIME type used when storing this in data table. */
713            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/name";
714
715            /**
716             * The given name for the contact.
717             * <P>Type: TEXT</P>
718             */
719            public static final String GIVEN_NAME = "data1";
720
721            /**
722             * The family name for the contact.
723             * <P>Type: TEXT</P>
724             */
725            public static final String FAMILY_NAME = "data2";
726
727            /**
728             * The contact's honorific prefix, e.g. "Sir"
729             * <P>Type: TEXT</P>
730             */
731            public static final String PREFIX = "data3";
732
733            /**
734             * The contact's middle name
735             * <P>Type: TEXT</P>
736             */
737            public static final String MIDDLE_NAME = "data4";
738
739            /**
740             * The contact's honorific suffix, e.g. "Jr"
741             */
742            public static final String SUFFIX = "data5";
743
744            /**
745             * The phonetic version of the given name for the contact.
746             * <P>Type: TEXT</P>
747             */
748            public static final String PHONETIC_GIVEN_NAME = "data6";
749
750            /**
751             * The phonetic version of the additional name for the contact.
752             * <P>Type: TEXT</P>
753             */
754            public static final String PHONETIC_MIDDLE_NAME = "data7";
755
756            /**
757             * The phonetic version of the family name for the contact.
758             * <P>Type: TEXT</P>
759             */
760            public static final String PHONETIC_FAMILY_NAME = "data8";
761
762            /**
763             * The name that should be used to display the contact.
764             * <P>Type: TEXT</P>
765             */
766            public static final String DISPLAY_NAME = "data9";
767        }
768
769        /**
770         * A nickname.
771         */
772        public static final class Nickname implements CommonColumns, BaseCommonColumns {
773            private Nickname() {}
774
775            /** MIME type used when storing this in data table. */
776            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/nickname";
777
778            public static final int TYPE_DEFAULT = 1;
779            public static final int TYPE_OTHER_NAME = 2;
780            public static final int TYPE_MAINDEN_NAME = 3;
781            public static final int TYPE_SHORT_NAME = 4;
782            public static final int TYPE_INITIALS = 5;
783
784            /**
785             * The name itself
786             */
787            public static final String NAME = DATA;
788        }
789
790        /**
791         * Common data definition for telephone numbers.
792         */
793        public static final class Phone implements BaseCommonColumns, CommonColumns {
794            private Phone() {}
795
796            /** MIME type used when storing this in data table. */
797            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone";
798
799            /**
800             * The MIME type of {@link #CONTENT_URI} providing a directory of
801             * phones.
802             */
803            public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone";
804
805            /**
806             * The content:// style URI for all data records of the
807             * {@link Phone#CONTENT_ITEM_TYPE} MIME type, combined with the
808             * associated contact and aggregate data.
809             */
810            public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
811                    "phones");
812
813            /**
814             * The content:// style URI for filtering data records of the
815             * {@link Phone#CONTENT_ITEM_TYPE} MIME type, combined with the
816             * associated contact and aggregate data. The filter argument should
817             * be passed as an additional path segment after this URI.
818             */
819            public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI,
820                    "filter");
821
822            public static final int TYPE_HOME = 1;
823            public static final int TYPE_MOBILE = 2;
824            public static final int TYPE_WORK = 3;
825            public static final int TYPE_FAX_WORK = 4;
826            public static final int TYPE_FAX_HOME = 5;
827            public static final int TYPE_PAGER = 6;
828            public static final int TYPE_OTHER = 7;
829
830            /**
831             * The phone number as the user entered it.
832             * <P>Type: TEXT</P>
833             */
834            public static final String NUMBER = DATA;
835        }
836
837        /**
838         * Common data definition for email addresses.
839         */
840        public static final class Email implements BaseCommonColumns, CommonColumns {
841            private Email() {}
842
843            /** MIME type used when storing this in data table. */
844            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/email";
845
846            public static final int TYPE_HOME = 1;
847            public static final int TYPE_WORK = 2;
848            public static final int TYPE_OTHER = 3;
849        }
850
851        /**
852         * Common data definition for postal addresses.
853         */
854        public static final class StructuredPostal implements BaseCommonColumns, CommonColumns {
855            private StructuredPostal() {
856            }
857
858            /** MIME type used when storing this in data table. */
859            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/postal-address";
860
861            /**
862             * The MIME type of {@link #CONTENT_URI} providing a directory of
863             * postal addresses.
864             */
865            public static final String CONTENT_TYPE = "vnd.android.cursor.dir/postal-address";
866
867            /**
868             * The content:// style URI for all data records of the
869             * {@link StructuredPostal#CONTENT_ITEM_TYPE} MIME type.
870             */
871            public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
872                    "postals");
873
874            public static final int TYPE_HOME = 1;
875            public static final int TYPE_WORK = 2;
876            public static final int TYPE_OTHER = 3;
877
878            /**
879             * The full, unstructured postal address.
880             * <p>
881             * Type: TEXT
882             */
883            public static final String FORMATTED_ADDRESS = DATA;
884
885            /**
886             * The agent who actually receives the mail. Used in work addresses.
887             * Also for 'in care of' or 'c/o'.
888             * <p>
889             * Type: TEXT
890             */
891            public static final String AGENT = "data4";
892
893            /**
894             * Used in places where houses or buildings have names (and not
895             * necessarily numbers), eg. "The Pillars".
896             * <p>
897             * Type: TEXT
898             */
899            public static final String HOUSENAME = "data5";
900
901            /**
902             * Can be street, avenue, road, etc. This element also includes the
903             * house number and room/apartment/flat/floor number.
904             * <p>
905             * Type: TEXT
906             */
907            public static final String STREET = "data6";
908
909            /**
910             * Covers actual P.O. boxes, drawers, locked bags, etc. This is
911             * usually but not always mutually exclusive with street.
912             * <p>
913             * Type: TEXT
914             */
915            public static final String POBOX = "data7";
916
917            /**
918             * This is used to disambiguate a street address when a city
919             * contains more than one street with the same name, or to specify a
920             * small place whose mail is routed through a larger postal town. In
921             * China it could be a county or a minor city.
922             * <p>
923             * Type: TEXT
924             */
925            public static final String NEIGHBORHOOD = "data8";
926
927            /**
928             * Can be city, village, town, borough, etc. This is the postal town
929             * and not necessarily the place of residence or place of business.
930             * <p>
931             * Type: TEXT
932             */
933            public static final String CITY = "data9";
934
935            /**
936             * Handles administrative districts such as U.S. or U.K. counties
937             * that are not used for mail addressing purposes. Subregion is not
938             * intended for delivery addresses.
939             * <p>
940             * Type: TEXT
941             */
942            public static final String SUBREGION = "data10";
943
944            /**
945             * A state, province, county (in Ireland), Land (in Germany),
946             * departement (in France), etc.
947             * <p>
948             * Type: TEXT
949             */
950            public static final String REGION = "data11";
951
952            /**
953             * Postal code. Usually country-wide, but sometimes specific to the
954             * city (e.g. "2" in "Dublin 2, Ireland" addresses).
955             * <p>
956             * Type: TEXT
957             */
958            public static final String POSTCODE = "data12";
959
960            /**
961             * The name or code of the country.
962             * <p>
963             * Type: TEXT
964             */
965            public static final String COUNTRY = "data13";
966        }
967
968       /**
969        * Common data definition for IM addresses.
970        */
971        public static final class Im implements BaseCommonColumns, CommonColumns {
972            private Im() {}
973
974            /** MIME type used when storing this in data table. */
975            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im";
976
977            public static final int TYPE_HOME = 1;
978            public static final int TYPE_WORK = 2;
979            public static final int TYPE_OTHER = 3;
980
981            public static final String PROTOCOL = "data5";
982
983            /**
984             * The predefined IM protocol types. The protocol can either be non-present, one
985             * of these types, or a free-form string. These cases are encoded in the PROTOCOL
986             * column as:
987             * <ul>
988             * <li>null</li>
989             * <li>pre:&lt;an integer, one of the protocols below&gt;</li>
990             * <li>custom:&lt;a string&gt;</li>
991             * </ul>
992             */
993            public static final int PROTOCOL_AIM = 0;
994            public static final int PROTOCOL_MSN = 1;
995            public static final int PROTOCOL_YAHOO = 2;
996            public static final int PROTOCOL_SKYPE = 3;
997            public static final int PROTOCOL_QQ = 4;
998            public static final int PROTOCOL_GOOGLE_TALK = 5;
999            public static final int PROTOCOL_ICQ = 6;
1000            public static final int PROTOCOL_JABBER = 7;
1001
1002            public static String encodePredefinedImProtocol(int protocol) {
1003               return "pre:" + protocol;
1004            }
1005
1006            public static String encodeCustomImProtocol(String protocolString) {
1007               return "custom:" + protocolString;
1008            }
1009
1010            public static Object decodeImProtocol(String encodedString) {
1011               if (encodedString == null) {
1012                   return null;
1013               }
1014
1015               if (encodedString.startsWith("pre:")) {
1016                   return Integer.parseInt(encodedString.substring(4));
1017               }
1018
1019               if (encodedString.startsWith("custom:")) {
1020                   return encodedString.substring(7);
1021               }
1022
1023               throw new IllegalArgumentException(
1024                       "the value is not a valid encoded protocol, " + encodedString);
1025            }
1026        }
1027
1028        /**
1029         * Common data definition for organizations.
1030         */
1031        public static final class Organization implements BaseCommonColumns, CommonColumns {
1032            private Organization() {}
1033
1034            /** MIME type used when storing this in data table. */
1035            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/organization";
1036
1037            public static final int TYPE_WORK = 1;
1038            public static final int TYPE_OTHER = 2;
1039
1040            /**
1041             * The company as the user entered it.
1042             * <P>Type: TEXT</P>
1043             */
1044            public static final String COMPANY = DATA;
1045
1046            /**
1047             * The position title at this company as the user entered it.
1048             * <P>Type: TEXT</P>
1049             */
1050            public static final String TITLE = "data4";
1051        }
1052
1053        /**
1054         * Photo of the contact.
1055         */
1056        public static final class Photo implements BaseCommonColumns {
1057            private Photo() {}
1058
1059            /** MIME type used when storing this in data table. */
1060            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/photo";
1061
1062            /**
1063             * Thumbnail photo of the contact. This is the raw bytes of an image
1064             * that could be inflated using {@link BitmapFactory}.
1065             * <p>
1066             * Type: BLOB
1067             */
1068            public static final String PHOTO = "data1";
1069        }
1070
1071        /**
1072         * Notes about the contact.
1073         */
1074        public static final class Note implements BaseCommonColumns {
1075            private Note() {}
1076
1077            /** MIME type used when storing this in data table. */
1078            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/note";
1079
1080            /**
1081             * The note text.
1082             * <P>Type: TEXT</P>
1083             */
1084            public static final String NOTE = "data1";
1085        }
1086
1087        /**
1088         * Group Membership.
1089         */
1090        public static final class GroupMembership implements BaseCommonColumns {
1091            private GroupMembership() {}
1092
1093            /** MIME type used when storing this in data table. */
1094            public static final String CONTENT_ITEM_TYPE =
1095                    "vnd.android.cursor.item/group_membership";
1096
1097            /**
1098             * The row id of the group that this group membership refers to. Exactly one of
1099             * this or {@link #GROUP_SOURCE_ID} must be set when inserting a row.
1100             * <P>Type: INTEGER</P>
1101             */
1102            public static final String GROUP_ROW_ID = "data1";
1103
1104            /**
1105             * The sourceid of the group that this group membership refers to.  Exactly one of
1106             * this or {@link #GROUP_ROW_ID} must be set when inserting a row.
1107             * <P>Type: TEXT</P>
1108             */
1109            public static final String GROUP_SOURCE_ID = "group_sourceid";
1110        }
1111
1112        /**
1113         * Website related to the contact.
1114         */
1115        public static final class Website implements BaseCommonColumns {
1116            private Website() {}
1117
1118            /** MIME type used when storing this in data table. */
1119            public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/website";
1120
1121            /**
1122             * The website URL string.
1123             * <P>Type: TEXT</P>
1124             */
1125            public static final String URL = "data1";
1126        }
1127    }
1128
1129    public interface GroupsColumns {
1130        /**
1131         * The display title of this group.
1132         * <p>
1133         * Type: TEXT
1134         */
1135        public static final String TITLE = "title";
1136
1137        /**
1138         * The package name to use when creating {@link Resources} objects for
1139         * this group. This value is only designed for use when building user
1140         * interfaces, and should not be used to infer the owner.
1141         */
1142        public static final String RES_PACKAGE = "res_package";
1143
1144        /**
1145         * The display title of this group to load as a resource from
1146         * {@link #RES_PACKAGE}, which may be localized.
1147         * <P>Type: TEXT</P>
1148         */
1149        public static final String TITLE_RES = "title_res";
1150
1151        /**
1152         * Notes about the group.
1153         * <p>
1154         * Type: TEXT
1155         */
1156        public static final String NOTES = "notes";
1157
1158        /**
1159         * The ID of this group if it is a System Group, i.e. a group that has a special meaning
1160         * to the sync adapter, null otherwise.
1161         * <P>Type: TEXT</P>
1162         */
1163        public static final String SYSTEM_ID = "system_id";
1164
1165        /**
1166         * The total number of {@link Aggregates} that have
1167         * {@link GroupMembership} in this group. Read-only value that is only
1168         * present when querying {@link Groups#CONTENT_SUMMARY_URI}.
1169         * <p>
1170         * Type: INTEGER
1171         */
1172        public static final String SUMMARY_COUNT = "summ_count";
1173
1174        /**
1175         * The total number of {@link Aggregates} that have both
1176         * {@link GroupMembership} in this group, and also have phone numbers.
1177         * Read-only value that is only present when querying
1178         * {@link Groups#CONTENT_SUMMARY_URI}.
1179         * <p>
1180         * Type: INTEGER
1181         */
1182        public static final String SUMMARY_WITH_PHONES = "summ_phones";
1183
1184        /**
1185         * Flag indicating if the contacts belonging to this group should be
1186         * visible in any user interface.
1187         * <p>
1188         * Type: INTEGER
1189         */
1190        public static final String GROUP_VISIBLE = "group_visible";
1191    }
1192
1193    /**
1194     * Constants for the groups table.
1195     */
1196    public static final class Groups implements BaseColumns, GroupsColumns, SyncColumns {
1197        /**
1198         * This utility class cannot be instantiated
1199         */
1200        private Groups() {
1201        }
1202
1203        /**
1204         * The content:// style URI for this table
1205         */
1206        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "groups");
1207
1208        /**
1209         * The content:// style URI for this table joined with details data from
1210         * {@link Data}.
1211         */
1212        public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI,
1213                "groups_summary");
1214
1215        /**
1216         * The MIME type of a directory of groups.
1217         */
1218        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/group";
1219
1220        /**
1221         * The MIME type of a single group.
1222         */
1223        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group";
1224    }
1225
1226    /**
1227     * Constants for the contact aggregation exceptions table, which contains
1228     * aggregation rules overriding those used by automatic aggregation.  This type only
1229     * supports query and update. Neither insert nor delete are supported.
1230     */
1231    public static final class AggregationExceptions implements BaseColumns {
1232        /**
1233         * This utility class cannot be instantiated
1234         */
1235        private AggregationExceptions() {}
1236
1237        /**
1238         * The content:// style URI for this table
1239         */
1240        public static final Uri CONTENT_URI =
1241                Uri.withAppendedPath(AUTHORITY_URI, "aggregation_exceptions");
1242
1243        /**
1244         * The MIME type of {@link #CONTENT_URI} providing a directory of data.
1245         */
1246        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception";
1247
1248        /**
1249         * The MIME type of a {@link #CONTENT_URI} subdirectory of an aggregation exception
1250         */
1251        public static final String CONTENT_ITEM_TYPE =
1252                "vnd.android.cursor.item/aggregation_exception";
1253
1254        /**
1255         * The type of exception: {@link #TYPE_KEEP_IN}, {@link #TYPE_KEEP_OUT} or
1256         * {@link #TYPE_AUTOMATIC}.
1257         *
1258         * <P>Type: INTEGER</P>
1259         */
1260        public static final String TYPE = "type";
1261
1262        /**
1263         * Allows the provider to automatically decide whether the aggregate should include
1264         * a particular contact or not.
1265         */
1266        public static final int TYPE_AUTOMATIC = 0;
1267
1268        /**
1269         * Makes sure that the specified contact is included in the specified aggregate.
1270         */
1271        public static final int TYPE_KEEP_IN = 1;
1272
1273        /**
1274         * Makes sure that the specified contact is NOT included in the specified aggregate.
1275         */
1276        public static final int TYPE_KEEP_OUT = 2;
1277
1278        /**
1279         * A reference to the {@link Aggregates#_ID} of the aggregate that the rule applies to.
1280         */
1281        public static final String AGGREGATE_ID = "aggregate_id";
1282
1283        /**
1284         * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of the
1285         * contact that the rule applies to.
1286         */
1287        public static final String CONTACT_ID = "contact_id";
1288    }
1289
1290    /**
1291     * Contains helper classes used to create or manage {@link android.content.Intent Intents}
1292     * that involve contacts.
1293     */
1294    public static final class Intents {
1295        /**
1296         * This is the intent that is fired when a search suggestion is clicked on.
1297         */
1298        public static final String SEARCH_SUGGESTION_CLICKED =
1299                "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED";
1300
1301        /**
1302         * This is the intent that is fired when a search suggestion for dialing a number
1303         * is clicked on.
1304         */
1305        public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED =
1306                "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED";
1307
1308        /**
1309         * This is the intent that is fired when a search suggestion for creating a contact
1310         * is clicked on.
1311         */
1312        public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED =
1313                "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED";
1314
1315        /**
1316         * Starts an Activity that lets the user pick a contact to attach an image to.
1317         * After picking the contact it launches the image cropper in face detection mode.
1318         */
1319        public static final String ATTACH_IMAGE =
1320                "com.android.contacts.action.ATTACH_IMAGE";
1321
1322        /**
1323         * Takes as input a data URI with a mailto: or tel: scheme. If a single
1324         * contact exists with the given data it will be shown. If no contact
1325         * exists, a dialog will ask the user if they want to create a new
1326         * contact with the provided details filled in. If multiple contacts
1327         * share the data the user will be prompted to pick which contact they
1328         * want to view.
1329         * <p>
1330         * For <code>mailto:</code> URIs, the scheme specific portion must be a
1331         * raw email address, such as one built using
1332         * {@link Uri#fromParts(String, String, String)}.
1333         * <p>
1334         * For <code>tel:</code> URIs, the scheme specific portion is compared
1335         * to existing numbers using the standard caller ID lookup algorithm.
1336         * The number must be properly encoded, for example using
1337         * {@link Uri#fromParts(String, String, String)}.
1338         * <p>
1339         * Any extras from the {@link Insert} class will be passed along to the
1340         * create activity if there are no contacts to show.
1341         * <p>
1342         * Passing true for the {@link #EXTRA_FORCE_CREATE} extra will skip
1343         * prompting the user when the contact doesn't exist.
1344         */
1345        public static final String SHOW_OR_CREATE_CONTACT =
1346                "com.android.contacts.action.SHOW_OR_CREATE_CONTACT";
1347
1348        /**
1349         * Used with {@link #SHOW_OR_CREATE_CONTACT} to force creating a new
1350         * contact if no matching contact found. Otherwise, default behavior is
1351         * to prompt user with dialog before creating.
1352         * <p>
1353         * Type: BOOLEAN
1354         */
1355        public static final String EXTRA_FORCE_CREATE =
1356                "com.android.contacts.action.FORCE_CREATE";
1357
1358        /**
1359         * Used with {@link #SHOW_OR_CREATE_CONTACT} to specify an exact
1360         * description to be shown when prompting user about creating a new
1361         * contact.
1362         * <p>
1363         * Type: STRING
1364         */
1365        public static final String EXTRA_CREATE_DESCRIPTION =
1366            "com.android.contacts.action.CREATE_DESCRIPTION";
1367
1368        /**
1369         * Intents related to the Contacts app UI.
1370         */
1371        public static final class UI {
1372            /**
1373             * The action for the default contacts list tab.
1374             */
1375            public static final String LIST_DEFAULT =
1376                    "com.android.contacts.action.LIST_DEFAULT";
1377
1378            /**
1379             * The action for the contacts list tab.
1380             */
1381            public static final String LIST_GROUP_ACTION =
1382                    "com.android.contacts.action.LIST_GROUP";
1383
1384            /**
1385             * When in LIST_GROUP_ACTION mode, this is the group to display.
1386             */
1387            public static final String GROUP_NAME_EXTRA_KEY = "com.android.contacts.extra.GROUP";
1388
1389            /**
1390             * The action for the all contacts list tab.
1391             */
1392            public static final String LIST_ALL_CONTACTS_ACTION =
1393                    "com.android.contacts.action.LIST_ALL_CONTACTS";
1394
1395            /**
1396             * The action for the contacts with phone numbers list tab.
1397             */
1398            public static final String LIST_CONTACTS_WITH_PHONES_ACTION =
1399                    "com.android.contacts.action.LIST_CONTACTS_WITH_PHONES";
1400
1401            /**
1402             * The action for the starred contacts list tab.
1403             */
1404            public static final String LIST_STARRED_ACTION =
1405                    "com.android.contacts.action.LIST_STARRED";
1406
1407            /**
1408             * The action for the frequent contacts list tab.
1409             */
1410            public static final String LIST_FREQUENT_ACTION =
1411                    "com.android.contacts.action.LIST_FREQUENT";
1412
1413            /**
1414             * The action for the "strequent" contacts list tab. It first lists the starred
1415             * contacts in alphabetical order and then the frequent contacts in descending
1416             * order of the number of times they have been contacted.
1417             */
1418            public static final String LIST_STREQUENT_ACTION =
1419                    "com.android.contacts.action.LIST_STREQUENT";
1420
1421            /**
1422             * A key for to be used as an intent extra to set the activity
1423             * title to a custom String value.
1424             */
1425            public static final String TITLE_EXTRA_KEY =
1426                "com.android.contacts.extra.TITLE_EXTRA";
1427
1428            /**
1429             * Activity Action: Display a filtered list of contacts
1430             * <p>
1431             * Input: Extra field {@link #FILTER_TEXT_EXTRA_KEY} is the text to use for
1432             * filtering
1433             * <p>
1434             * Output: Nothing.
1435             */
1436            public static final String FILTER_CONTACTS_ACTION =
1437                "com.android.contacts.action.FILTER_CONTACTS";
1438
1439            /**
1440             * Used as an int extra field in {@link #FILTER_CONTACTS_ACTION}
1441             * intents to supply the text on which to filter.
1442             */
1443            public static final String FILTER_TEXT_EXTRA_KEY =
1444                "com.android.contacts.extra.FILTER_TEXT";
1445        }
1446
1447        /**
1448         * Convenience class that contains string constants used
1449         * to create contact {@link android.content.Intent Intents}.
1450         */
1451        public static final class Insert {
1452            /** The action code to use when adding a contact */
1453            public static final String ACTION = Intent.ACTION_INSERT;
1454
1455            /**
1456             * If present, forces a bypass of quick insert mode.
1457             */
1458            public static final String FULL_MODE = "full_mode";
1459
1460            /**
1461             * The extra field for the contact name.
1462             * <P>Type: String</P>
1463             */
1464            public static final String NAME = "name";
1465
1466            // TODO add structured name values here.
1467
1468            /**
1469             * The extra field for the contact phonetic name.
1470             * <P>Type: String</P>
1471             */
1472            public static final String PHONETIC_NAME = "phonetic_name";
1473
1474            /**
1475             * The extra field for the contact company.
1476             * <P>Type: String</P>
1477             */
1478            public static final String COMPANY = "company";
1479
1480            /**
1481             * The extra field for the contact job title.
1482             * <P>Type: String</P>
1483             */
1484            public static final String JOB_TITLE = "job_title";
1485
1486            /**
1487             * The extra field for the contact notes.
1488             * <P>Type: String</P>
1489             */
1490            public static final String NOTES = "notes";
1491
1492            /**
1493             * The extra field for the contact phone number.
1494             * <P>Type: String</P>
1495             */
1496            public static final String PHONE = "phone";
1497
1498            /**
1499             * The extra field for the contact phone number type.
1500             * <P>Type: Either an integer value from
1501             * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
1502             *  or a string specifying a custom label.</P>
1503             */
1504            public static final String PHONE_TYPE = "phone_type";
1505
1506            /**
1507             * The extra field for the phone isprimary flag.
1508             * <P>Type: boolean</P>
1509             */
1510            public static final String PHONE_ISPRIMARY = "phone_isprimary";
1511
1512            /**
1513             * The extra field for an optional second contact phone number.
1514             * <P>Type: String</P>
1515             */
1516            public static final String SECONDARY_PHONE = "secondary_phone";
1517
1518            /**
1519             * The extra field for an optional second contact phone number type.
1520             * <P>Type: Either an integer value from
1521             * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
1522             *  or a string specifying a custom label.</P>
1523             */
1524            public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type";
1525
1526            /**
1527             * The extra field for an optional third contact phone number.
1528             * <P>Type: String</P>
1529             */
1530            public static final String TERTIARY_PHONE = "tertiary_phone";
1531
1532            /**
1533             * The extra field for an optional third contact phone number type.
1534             * <P>Type: Either an integer value from
1535             * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
1536             *  or a string specifying a custom label.</P>
1537             */
1538            public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
1539
1540            /**
1541             * The extra field for the contact email address.
1542             * <P>Type: String</P>
1543             */
1544            public static final String EMAIL = "email";
1545
1546            /**
1547             * The extra field for the contact email type.
1548             * <P>Type: Either an integer value from
1549             * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
1550             *  or a string specifying a custom label.</P>
1551             */
1552            public static final String EMAIL_TYPE = "email_type";
1553
1554            /**
1555             * The extra field for the email isprimary flag.
1556             * <P>Type: boolean</P>
1557             */
1558            public static final String EMAIL_ISPRIMARY = "email_isprimary";
1559
1560            /**
1561             * The extra field for an optional second contact email address.
1562             * <P>Type: String</P>
1563             */
1564            public static final String SECONDARY_EMAIL = "secondary_email";
1565
1566            /**
1567             * The extra field for an optional second contact email type.
1568             * <P>Type: Either an integer value from
1569             * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
1570             *  or a string specifying a custom label.</P>
1571             */
1572            public static final String SECONDARY_EMAIL_TYPE = "secondary_email_type";
1573
1574            /**
1575             * The extra field for an optional third contact email address.
1576             * <P>Type: String</P>
1577             */
1578            public static final String TERTIARY_EMAIL = "tertiary_email";
1579
1580            /**
1581             * The extra field for an optional third contact email type.
1582             * <P>Type: Either an integer value from
1583             * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
1584             *  or a string specifying a custom label.</P>
1585             */
1586            public static final String TERTIARY_EMAIL_TYPE = "tertiary_email_type";
1587
1588            /**
1589             * The extra field for the contact postal address.
1590             * <P>Type: String</P>
1591             */
1592            public static final String POSTAL = "postal";
1593
1594            /**
1595             * The extra field for the contact postal address type.
1596             * <P>Type: Either an integer value from
1597             * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
1598             *  or a string specifying a custom label.</P>
1599             */
1600            public static final String POSTAL_TYPE = "postal_type";
1601
1602            /**
1603             * The extra field for the postal isprimary flag.
1604             * <P>Type: boolean</P>
1605             */
1606            public static final String POSTAL_ISPRIMARY = "postal_isprimary";
1607
1608            /**
1609             * The extra field for an IM handle.
1610             * <P>Type: String</P>
1611             */
1612            public static final String IM_HANDLE = "im_handle";
1613
1614            /**
1615             * The extra field for the IM protocol
1616             * <P>Type: the result of {@link CommonDataKinds.Im#encodePredefinedImProtocol(int)}
1617             * or {@link CommonDataKinds.Im#encodeCustomImProtocol(String)}.</P>
1618             */
1619            public static final String IM_PROTOCOL = "im_protocol";
1620
1621            /**
1622             * The extra field for the IM isprimary flag.
1623             * <P>Type: boolean</P>
1624             */
1625            public static final String IM_ISPRIMARY = "im_isprimary";
1626        }
1627    }
1628
1629}
1630