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