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