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