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