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