ContactsContract.java revision c991bfc53ff287c512a8ba567135499cc4157900
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. Either this or the 966 * GROUP_SOURCE_ID must be set. If they are both set then they must refer to the same 967 * group. 968 * <P>Type: INTEGER</P> 969 */ 970 public static final String GROUP_ROW_ID = "data1"; 971 972 /** 973 * The source id of the group that this membership refers to. Either this or the 974 * GROUP_ROW_ID must be set. If they are both set then they must refer to the same 975 * group. 976 * <P>Type: STRING</P> 977 */ 978 public static final String GROUP_SOURCE_ID = "data2"; 979 } 980 } 981 982 public interface GroupsColumns { 983 /** 984 * The package name that owns this group. 985 */ 986 public static final String PACKAGE = "package"; 987 988 /** 989 * A unique identifier for the package that owns this group. 990 */ 991 public static final String PACKAGE_ID = "package_id"; 992 993 /** 994 * The display title of this group. 995 * <p> 996 * Type: TEXT 997 */ 998 public static final String TITLE = "title"; 999 1000 /** 1001 * The display title of this group to load as a resource from 1002 * {@link #PACKAGE}, which may be localized. 1003 * <p> 1004 * Type: TEXT 1005 */ 1006 public static final String TITLE_RESOURCE = "title_res"; 1007 1008 /** 1009 * The total number of {@link Aggregates} that have 1010 * {@link GroupMembership} in this group. Read-only value that is only 1011 * present when querying {@link Groups#CONTENT_SUMMARY_URI}. 1012 * <p> 1013 * Type: INTEGER 1014 */ 1015 public static final String SUMMARY_COUNT = "summ_count"; 1016 1017 /** 1018 * The total number of {@link Aggregates} that have both 1019 * {@link GroupMembership} in this group, and also have phone numbers. 1020 * Read-only value that is only present when querying 1021 * {@link Groups#CONTENT_SUMMARY_URI}. 1022 * <p> 1023 * Type: INTEGER 1024 */ 1025 public static final String SUMMARY_WITH_PHONES = "summ_phones"; 1026 1027 /** 1028 * A reference to the name of the account to which this data belongs 1029 */ 1030 public static final String ACCOUNT_NAME = "account_name"; 1031 1032 /** 1033 * A reference to the type of the account to which this data belongs 1034 */ 1035 public static final String ACCOUNT_TYPE = "account_type"; 1036 1037 /** 1038 * A string that uniquely identifies this contact to its source, which is referred to 1039 * by the {@link #ACCOUNT_NAME} and {@link #ACCOUNT_TYPE} 1040 */ 1041 public static final String SOURCE_ID = "sourceid"; 1042 1043 /** 1044 * An integer that is updated whenever this contact or its data changes. 1045 */ 1046 public static final String VERSION = "version"; 1047 1048 /** 1049 * Set to 1 whenever the version changes 1050 */ 1051 public static final String DIRTY = "dirty"; 1052 1053 /** 1054 * Flag indicating if the contacts belonging to this group should be 1055 * visible in any user interface. 1056 * <p> 1057 * Type: INTEGER 1058 */ 1059 public static final String GROUP_VISIBLE = "group_visible"; 1060 } 1061 1062 /** 1063 * Constants for the groups table. 1064 */ 1065 public static final class Groups implements BaseColumns, GroupsColumns { 1066 /** 1067 * This utility class cannot be instantiated 1068 */ 1069 private Groups() {} 1070 1071 /** 1072 * The content:// style URI for this table 1073 */ 1074 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "groups"); 1075 1076 /** 1077 * The content:// style URI for this table joined with details data from 1078 * {@link Data} and {@link Presence}. 1079 */ 1080 public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI, 1081 "groups_summary"); 1082 1083 /** 1084 * The MIME type of a directory of groups. 1085 */ 1086 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/group"; 1087 1088 /** 1089 * The MIME type of a single group. 1090 */ 1091 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group"; 1092 } 1093 1094 /** 1095 * Constants for the contact aggregation exceptions table, which contains 1096 * aggregation rules overriding those used by automatic aggregation. This type only 1097 * supports query and update. Neither insert nor delete are supported. 1098 */ 1099 public static final class AggregationExceptions implements BaseColumns { 1100 /** 1101 * This utility class cannot be instantiated 1102 */ 1103 private AggregationExceptions() {} 1104 1105 /** 1106 * The content:// style URI for this table 1107 */ 1108 public static final Uri CONTENT_URI = 1109 Uri.withAppendedPath(AUTHORITY_URI, "aggregation_exceptions"); 1110 1111 /** 1112 * The MIME type of {@link #CONTENT_URI} providing a directory of data. 1113 */ 1114 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception"; 1115 1116 /** 1117 * The MIME type of a {@link #CONTENT_URI} subdirectory of an aggregation exception 1118 */ 1119 public static final String CONTENT_ITEM_TYPE = 1120 "vnd.android.cursor.item/aggregation_exception"; 1121 1122 /** 1123 * The type of exception: {@link #TYPE_KEEP_IN}, {@link #TYPE_KEEP_OUT} or 1124 * {@link #TYPE_AUTOMATIC}. 1125 * 1126 * <P>Type: INTEGER</P> 1127 */ 1128 public static final String TYPE = "type"; 1129 1130 /** 1131 * Allows the provider to automatically decide whether the aggregate should include 1132 * a particular contact or not. 1133 */ 1134 public static final int TYPE_AUTOMATIC = 0; 1135 1136 /** 1137 * Makes sure that the specified contact is included in the specified aggregate. 1138 */ 1139 public static final int TYPE_KEEP_IN = 1; 1140 1141 /** 1142 * Makes sure that the specified contact is NOT included in the specified aggregate. 1143 */ 1144 public static final int TYPE_KEEP_OUT = 2; 1145 1146 /** 1147 * A reference to the {@link Aggregates#_ID} of the aggregate that the rule applies to. 1148 */ 1149 public static final String AGGREGATE_ID = "aggregate_id"; 1150 1151 /** 1152 * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of the 1153 * contact that the rule applies to. 1154 */ 1155 public static final String CONTACT_ID = "contact_id"; 1156 } 1157 1158 private interface RestrictionExceptionsColumns { 1159 /** 1160 * Package name of a specific data provider, which will be matched 1161 * against {@link Data#PACKAGE}. 1162 * <p> 1163 * Type: STRING 1164 */ 1165 public static final String PACKAGE_PROVIDER = "package_provider"; 1166 1167 /** 1168 * Package name of a specific data client, which will be matched against 1169 * the incoming {@link android.os.Binder#getCallingUid()} to decide if 1170 * the caller can access values with {@link Data#IS_RESTRICTED} flags. 1171 * <p> 1172 * Type: STRING 1173 */ 1174 public static final String PACKAGE_CLIENT = "package_client"; 1175 1176 /** 1177 * Flag indicating if {@link #PACKAGE_PROVIDER} allows 1178 * {@link #PACKAGE_CLIENT} to access restricted {@link Data} rows. 1179 * <p> 1180 * Type: INTEGER 1181 */ 1182 public static final String ALLOW_ACCESS = "allow_access"; 1183 } 1184 1185 /** 1186 * Constants for {@link Data} restriction exceptions. Sync adapters who 1187 * insert restricted data can use this table to specify exceptions about 1188 * which additional packages can access that restricted data.You can only 1189 * modify rules for a {@link RestrictionExceptionsColumns#PACKAGE_PROVIDER} 1190 * that your {@link android.os.Binder#getCallingUid()} owns. 1191 */ 1192 public static final class RestrictionExceptions implements RestrictionExceptionsColumns { 1193 /** 1194 * This utility class cannot be instantiated 1195 */ 1196 private RestrictionExceptions() {} 1197 1198 /** 1199 * The content:// style URI for this table 1200 */ 1201 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, 1202 "restriction_exceptions"); 1203 } 1204 1205 /** 1206 * Contains helper classes used to create or manage {@link android.content.Intent Intents} 1207 * that involve contacts. 1208 */ 1209 public static final class Intents { 1210 /** 1211 * This is the intent that is fired when a search suggestion is clicked on. 1212 */ 1213 public static final String SEARCH_SUGGESTION_CLICKED = 1214 "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED"; 1215 1216 /** 1217 * This is the intent that is fired when a search suggestion for dialing a number 1218 * is clicked on. 1219 */ 1220 public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED = 1221 "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED"; 1222 1223 /** 1224 * This is the intent that is fired when a search suggestion for creating a contact 1225 * is clicked on. 1226 */ 1227 public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED = 1228 "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED"; 1229 1230 /** 1231 * Starts an Activity that lets the user pick a contact to attach an image to. 1232 * After picking the contact it launches the image cropper in face detection mode. 1233 */ 1234 public static final String ATTACH_IMAGE = 1235 "com.android.contacts.action.ATTACH_IMAGE"; 1236 1237 /** 1238 * Takes as input a data URI with a mailto: or tel: scheme. If a single 1239 * contact exists with the given data it will be shown. If no contact 1240 * exists, a dialog will ask the user if they want to create a new 1241 * contact with the provided details filled in. If multiple contacts 1242 * share the data the user will be prompted to pick which contact they 1243 * want to view. 1244 * <p> 1245 * For <code>mailto:</code> URIs, the scheme specific portion must be a 1246 * raw email address, such as one built using 1247 * {@link Uri#fromParts(String, String, String)}. 1248 * <p> 1249 * For <code>tel:</code> URIs, the scheme specific portion is compared 1250 * to existing numbers using the standard caller ID lookup algorithm. 1251 * The number must be properly encoded, for example using 1252 * {@link Uri#fromParts(String, String, String)}. 1253 * <p> 1254 * Any extras from the {@link Insert} class will be passed along to the 1255 * create activity if there are no contacts to show. 1256 * <p> 1257 * Passing true for the {@link #EXTRA_FORCE_CREATE} extra will skip 1258 * prompting the user when the contact doesn't exist. 1259 */ 1260 public static final String SHOW_OR_CREATE_CONTACT = 1261 "com.android.contacts.action.SHOW_OR_CREATE_CONTACT"; 1262 1263 /** 1264 * Used with {@link #SHOW_OR_CREATE_CONTACT} to force creating a new 1265 * contact if no matching contact found. Otherwise, default behavior is 1266 * to prompt user with dialog before creating. 1267 * <p> 1268 * Type: BOOLEAN 1269 */ 1270 public static final String EXTRA_FORCE_CREATE = 1271 "com.android.contacts.action.FORCE_CREATE"; 1272 1273 /** 1274 * Used with {@link #SHOW_OR_CREATE_CONTACT} to specify an exact 1275 * description to be shown when prompting user about creating a new 1276 * contact. 1277 * <p> 1278 * Type: STRING 1279 */ 1280 public static final String EXTRA_CREATE_DESCRIPTION = 1281 "com.android.contacts.action.CREATE_DESCRIPTION"; 1282 1283 /** 1284 * Intents related to the Contacts app UI. 1285 */ 1286 public static final class UI { 1287 /** 1288 * The action for the default contacts list tab. 1289 */ 1290 public static final String LIST_DEFAULT = 1291 "com.android.contacts.action.LIST_DEFAULT"; 1292 1293 /** 1294 * The action for the contacts list tab. 1295 */ 1296 public static final String LIST_GROUP_ACTION = 1297 "com.android.contacts.action.LIST_GROUP"; 1298 1299 /** 1300 * When in LIST_GROUP_ACTION mode, this is the group to display. 1301 */ 1302 public static final String GROUP_NAME_EXTRA_KEY = "com.android.contacts.extra.GROUP"; 1303 1304 /** 1305 * The action for the all contacts list tab. 1306 */ 1307 public static final String LIST_ALL_CONTACTS_ACTION = 1308 "com.android.contacts.action.LIST_ALL_CONTACTS"; 1309 1310 /** 1311 * The action for the contacts with phone numbers list tab. 1312 */ 1313 public static final String LIST_CONTACTS_WITH_PHONES_ACTION = 1314 "com.android.contacts.action.LIST_CONTACTS_WITH_PHONES"; 1315 1316 /** 1317 * The action for the starred contacts list tab. 1318 */ 1319 public static final String LIST_STARRED_ACTION = 1320 "com.android.contacts.action.LIST_STARRED"; 1321 1322 /** 1323 * The action for the frequent contacts list tab. 1324 */ 1325 public static final String LIST_FREQUENT_ACTION = 1326 "com.android.contacts.action.LIST_FREQUENT"; 1327 1328 /** 1329 * The action for the "strequent" contacts list tab. It first lists the starred 1330 * contacts in alphabetical order and then the frequent contacts in descending 1331 * order of the number of times they have been contacted. 1332 */ 1333 public static final String LIST_STREQUENT_ACTION = 1334 "com.android.contacts.action.LIST_STREQUENT"; 1335 1336 /** 1337 * A key for to be used as an intent extra to set the activity 1338 * title to a custom String value. 1339 */ 1340 public static final String TITLE_EXTRA_KEY = 1341 "com.android.contacts.extra.TITLE_EXTRA"; 1342 1343 /** 1344 * Activity Action: Display a filtered list of contacts 1345 * <p> 1346 * Input: Extra field {@link #FILTER_TEXT_EXTRA_KEY} is the text to use for 1347 * filtering 1348 * <p> 1349 * Output: Nothing. 1350 */ 1351 public static final String FILTER_CONTACTS_ACTION = 1352 "com.android.contacts.action.FILTER_CONTACTS"; 1353 1354 /** 1355 * Used as an int extra field in {@link #FILTER_CONTACTS_ACTION} 1356 * intents to supply the text on which to filter. 1357 */ 1358 public static final String FILTER_TEXT_EXTRA_KEY = 1359 "com.android.contacts.extra.FILTER_TEXT"; 1360 } 1361 1362 /** 1363 * Convenience class that contains string constants used 1364 * to create contact {@link android.content.Intent Intents}. 1365 */ 1366 public static final class Insert { 1367 /** The action code to use when adding a contact */ 1368 public static final String ACTION = Intent.ACTION_INSERT; 1369 1370 /** 1371 * If present, forces a bypass of quick insert mode. 1372 */ 1373 public static final String FULL_MODE = "full_mode"; 1374 1375 /** 1376 * The extra field for the contact name. 1377 * <P>Type: String</P> 1378 */ 1379 public static final String NAME = "name"; 1380 1381 // TODO add structured name values here. 1382 1383 /** 1384 * The extra field for the contact phonetic name. 1385 * <P>Type: String</P> 1386 */ 1387 public static final String PHONETIC_NAME = "phonetic_name"; 1388 1389 /** 1390 * The extra field for the contact company. 1391 * <P>Type: String</P> 1392 */ 1393 public static final String COMPANY = "company"; 1394 1395 /** 1396 * The extra field for the contact job title. 1397 * <P>Type: String</P> 1398 */ 1399 public static final String JOB_TITLE = "job_title"; 1400 1401 /** 1402 * The extra field for the contact notes. 1403 * <P>Type: String</P> 1404 */ 1405 public static final String NOTES = "notes"; 1406 1407 /** 1408 * The extra field for the contact phone number. 1409 * <P>Type: String</P> 1410 */ 1411 public static final String PHONE = "phone"; 1412 1413 /** 1414 * The extra field for the contact phone number type. 1415 * <P>Type: Either an integer value from 1416 * {@link android.provider.Contacts.PhonesColumns PhonesColumns}, 1417 * or a string specifying a custom label.</P> 1418 */ 1419 public static final String PHONE_TYPE = "phone_type"; 1420 1421 /** 1422 * The extra field for the phone isprimary flag. 1423 * <P>Type: boolean</P> 1424 */ 1425 public static final String PHONE_ISPRIMARY = "phone_isprimary"; 1426 1427 /** 1428 * The extra field for an optional second contact phone number. 1429 * <P>Type: String</P> 1430 */ 1431 public static final String SECONDARY_PHONE = "secondary_phone"; 1432 1433 /** 1434 * The extra field for an optional second contact phone number type. 1435 * <P>Type: Either an integer value from 1436 * {@link android.provider.Contacts.PhonesColumns PhonesColumns}, 1437 * or a string specifying a custom label.</P> 1438 */ 1439 public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type"; 1440 1441 /** 1442 * The extra field for an optional third contact phone number. 1443 * <P>Type: String</P> 1444 */ 1445 public static final String TERTIARY_PHONE = "tertiary_phone"; 1446 1447 /** 1448 * The extra field for an optional third contact phone number type. 1449 * <P>Type: Either an integer value from 1450 * {@link android.provider.Contacts.PhonesColumns PhonesColumns}, 1451 * or a string specifying a custom label.</P> 1452 */ 1453 public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type"; 1454 1455 /** 1456 * The extra field for the contact email address. 1457 * <P>Type: String</P> 1458 */ 1459 public static final String EMAIL = "email"; 1460 1461 /** 1462 * The extra field for the contact email type. 1463 * <P>Type: Either an integer value from 1464 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} 1465 * or a string specifying a custom label.</P> 1466 */ 1467 public static final String EMAIL_TYPE = "email_type"; 1468 1469 /** 1470 * The extra field for the email isprimary flag. 1471 * <P>Type: boolean</P> 1472 */ 1473 public static final String EMAIL_ISPRIMARY = "email_isprimary"; 1474 1475 /** 1476 * The extra field for an optional second contact email address. 1477 * <P>Type: String</P> 1478 */ 1479 public static final String SECONDARY_EMAIL = "secondary_email"; 1480 1481 /** 1482 * The extra field for an optional second contact email type. 1483 * <P>Type: Either an integer value from 1484 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} 1485 * or a string specifying a custom label.</P> 1486 */ 1487 public static final String SECONDARY_EMAIL_TYPE = "secondary_email_type"; 1488 1489 /** 1490 * The extra field for an optional third contact email address. 1491 * <P>Type: String</P> 1492 */ 1493 public static final String TERTIARY_EMAIL = "tertiary_email"; 1494 1495 /** 1496 * The extra field for an optional third contact email type. 1497 * <P>Type: Either an integer value from 1498 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} 1499 * or a string specifying a custom label.</P> 1500 */ 1501 public static final String TERTIARY_EMAIL_TYPE = "tertiary_email_type"; 1502 1503 /** 1504 * The extra field for the contact postal address. 1505 * <P>Type: String</P> 1506 */ 1507 public static final String POSTAL = "postal"; 1508 1509 /** 1510 * The extra field for the contact postal address type. 1511 * <P>Type: Either an integer value from 1512 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} 1513 * or a string specifying a custom label.</P> 1514 */ 1515 public static final String POSTAL_TYPE = "postal_type"; 1516 1517 /** 1518 * The extra field for the postal isprimary flag. 1519 * <P>Type: boolean</P> 1520 */ 1521 public static final String POSTAL_ISPRIMARY = "postal_isprimary"; 1522 1523 /** 1524 * The extra field for an IM handle. 1525 * <P>Type: String</P> 1526 */ 1527 public static final String IM_HANDLE = "im_handle"; 1528 1529 /** 1530 * The extra field for the IM protocol 1531 * <P>Type: the result of {@link Contacts.ContactMethods#encodePredefinedImProtocol} 1532 * or {@link Contacts.ContactMethods#encodeCustomImProtocol}.</P> 1533 */ 1534 public static final String IM_PROTOCOL = "im_protocol"; 1535 1536 /** 1537 * The extra field for the IM isprimary flag. 1538 * <P>Type: boolean</P> 1539 */ 1540 public static final String IM_ISPRIMARY = "im_isprimary"; 1541 } 1542 } 1543 1544} 1545