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