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