# ContactsContract.RawContacts

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# RawContacts

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts "View this page in Java")  

```
class RawContacts : BaseColumns, ContactsContract.ContactNameColumns, ContactsContract.ContactOptionsColumns, ContactsContract.RawContactsColumns, ContactsContract.SyncColumns
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                 ||
| ↳ | [android.provider.ContactsContract.RawContacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#) |

Constants for the raw contacts table, which contains one row of contact information for each person in each synced account. Sync adapters and contact management apps are the primary consumers of this API.

### Aggregation

<br />

As soon as a raw contact is inserted or whenever its constituent data changes, the provider will check if the raw contact matches other existing raw contacts and if so will aggregate it with those. The aggregation is reflected in the[RawContacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#)table by the change of the[CONTACT_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#CONTACT_ID:kotlin.String)field, which is the reference to the aggregate contact.

Changes to the structured name, organization, phone number, email address, or nickname trigger a re-aggregation.

See also[AggregationExceptions](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.AggregationExceptions)for a mechanism to control aggregation programmatically.

### Operations

**Insert**

:   Raw contacts can be inserted incrementally or in a batch. The incremental method is more traditional but less efficient. It should be used only if no[Data](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts.Data)values are available at the time the raw contact is created:

    ```kotlin
    ContentValues values = new ContentValues();
      values.put(RawContacts.ACCOUNT_TYPE, accountType);
      values.put(RawContacts.ACCOUNT_NAME, accountName);
      Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values);
      long rawContactId = ContentUris.parseId(rawContactUri);
      
    ```

    <br />

    Once[Data](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts.Data)values become available, insert those. For example, here's how you would insert a name:  

    ```kotlin
    values.clear();
      values.put(Data.RAW_CONTACT_ID, rawContactId);
      values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
      values.put(StructuredName.DISPLAY_NAME, "Mike Sullivan");
      getContentResolver().insert(Data.CONTENT_URI, values);
      
    ```

    <br />

    The batch method is by far preferred. It inserts the raw contact and its constituent data rows in a single database transaction and causes at most one aggregation pass.  

    ```kotlin
    ArrayList<ContentProviderOperation> ops =
               new ArrayList<ContentProviderOperation>();
      ...
      int rawContactInsertIndex = ops.size();
      ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI)
               .withValue(RawContacts.ACCOUNT_TYPE, accountType)
               .withValue(RawContacts.ACCOUNT_NAME, accountName)
               .build());
     
      ops.add(ContentProviderOperation.newInsert(Data.CONTENT_URI)
               .withValueBackReference(Data.RAW_CONTACT_ID, rawContactInsertIndex)
               .withValue(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE)
               .withValue(StructuredName.DISPLAY_NAME, "Mike Sullivan")
               .build());
     
      getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
      
    ```

    <br />

    Note the use of[ContentProviderOperation.Builder.withValueBackReference(String, int)](https://developer.android.com/reference/kotlin/android/content/ContentProviderOperation.Builder.html#withValueBackReference(kotlin.String,%20kotlin.Int))to refer to the as-yet-unknown index value of the raw contact inserted in the first operation.

**Update**
:   Raw contacts can be updated incrementally or in a batch. Batch mode should be used whenever possible. The procedures and considerations are analogous to those documented above for inserts.

**Delete**

:   When a raw contact is deleted, all of its Data rows as well as StatusUpdates, AggregationExceptions, PhoneLookup rows are deleted automatically. When all raw contacts associated with a[Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)row are deleted, the[Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)row itself is also deleted automatically.

    The invocation of`resolver.delete(...)`, does not immediately delete a raw contacts row. Instead, it sets the[DELETED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#DELETED:kotlin.String)flag on the raw contact and removes the raw contact from its aggregate contact. The sync adapter then deletes the raw contact from the server and finalizes phone-side deletion by calling`resolver.delete(...)`again and passing the[ContactsContract.CALLER_IS_SYNCADAPTER](https://developer.android.com/reference/kotlin/android/provider/ContactsContract#CALLER_IS_SYNCADAPTER:kotlin.String)query parameter.

    <br />

    Some sync adapters are read-only, meaning that they only sync server-side changes to the phone, but not the reverse. If one of those raw contacts is marked for deletion, it will remain on the phone. However it will be effectively invisible, because it will not be part of any aggregate contact.

**Query**

:   It is easy to find all raw contacts in a Contact:

    ```kotlin
    Cursor c = getContentResolver().query(RawContacts.CONTENT_URI,
               new String[]{RawContacts._ID},
               RawContacts.CONTACT_ID + "=?",
               new String[]{String.valueOf(contactId)}, null);
      
    ```

    <br />

    To find raw contacts within a specific account, you can either put the account name and type in the selection or pass them as query parameters. The latter approach is preferable, especially when you can reuse the URI:  

    ```kotlin
    Uri rawContactUri = RawContacts.CONTENT_URI.buildUpon()
               .appendQueryParameter(RawContacts.ACCOUNT_NAME, accountName)
               .appendQueryParameter(RawContacts.ACCOUNT_TYPE, accountType)
               .build();
      Cursor c1 = getContentResolver().query(rawContactUri,
               RawContacts.STARRED + "<>0", null, null, null);
      ...
      Cursor c2 = getContentResolver().query(rawContactUri,
               RawContacts.DELETED + "<>0", null, null, null);
      
    ```

    <br />

    The best way to read a raw contact along with all the data associated with it is by using the[Entity](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts.Entity)directory. If the raw contact has data rows, the Entity cursor will contain a row for each data row. If the raw contact has no data rows, the cursor will still contain one row with the raw contact-level information.  

    ```kotlin
    Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);
      Uri entityUri = Uri.withAppendedPath(rawContactUri, Entity.CONTENT_DIRECTORY);
      Cursor c = getContentResolver().query(entityUri,
               new String[]{RawContacts.SOURCE_ID, Entity.DATA_ID, Entity.MIMETYPE, Entity.DATA1},
               null, null, null);
      try {
          while (c.moveToNext()) {
              String sourceId = c.getString(0);
              if (!c.isNull(1)) {
                  String mimeType = c.getString(2);
                  String data = c.getString(3);
                  ...
              }
          }
      } finally {
          c.close();
      }
      
    ```

    <br />

## Columns

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      RawContacts                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||||
|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| long   | [_ID](https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_ID:kotlin.String)                                                        | read-only       | Row ID. Sync adapters should try to preserve row IDs during updates. In other words, it is much better for a sync adapter to update a raw contact rather than to delete and re-insert it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| long   | [CONTACT_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#CONTACT_ID:kotlin.String)                  | read-only       | The ID of the row in the[ContactsContract.Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)table that this raw contact belongs to. Raw contacts are linked to contacts by the aggregation process, which can be controlled by the[AGGREGATION_MODE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#AGGREGATION_MODE:kotlin.String)field and[AggregationExceptions](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.AggregationExceptions).                                                                                                                                                                                                                                                                                                                                                                              |
| int    | [AGGREGATION_MODE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#AGGREGATION_MODE:kotlin.String)      | read/write      | A mechanism that allows programmatic control of the aggregation process. The allowed values are[AGGREGATION_MODE_DEFAULT](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_DEFAULT:kotlin.Int),[AGGREGATION_MODE_DISABLED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_DISABLED:kotlin.Int)and[AGGREGATION_MODE_SUSPENDED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_SUSPENDED:kotlin.Int). See also[AggregationExceptions](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.AggregationExceptions).                                                                                                                                                                                                                          |
| int    | [DELETED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#DELETED:kotlin.String)                        | read/write      | The "deleted" flag: "0" by default, "1" if the row has been marked for deletion. When android.content.ContentResolver#delete is called on a raw contact, it is marked for deletion and removed from its aggregate contact. The sync adaptor deletes the raw contact on the server and then calls ContactResolver.delete once more, this time passing the[ContactsContract.CALLER_IS_SYNCADAPTER](https://developer.android.com/reference/kotlin/android/provider/ContactsContract#CALLER_IS_SYNCADAPTER:kotlin.String)query parameter to finalize the data removal.                                                                                                                                                                                                                                                                                                                                                                                              |
| int    | [STARRED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#STARRED:kotlin.String)                     | read/write      | An indicator for favorite contacts: '1' if favorite, '0' otherwise. Changing this field immediately affects the corresponding aggregate contact: if any raw contacts in that aggregate contact are starred, then the contact itself is marked as starred.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| String | [CUSTOM_RINGTONE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#CUSTOM_RINGTONE:kotlin.String)     | read/write      | A custom ringtone associated with a raw contact. Typically this is the URI returned by an activity launched with the[android.media.RingtoneManager#ACTION_RINGTONE_PICKER](https://developer.android.com/reference/kotlin/android/media/RingtoneManager.html#ACTION_RINGTONE_PICKER:kotlin.String)intent. To have an effect on the corresponding value of the aggregate contact, this field should be set at the time the raw contact is inserted. To set a custom ringtone on a contact, use the field[Contacts.CUSTOM_RINGTONE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#CUSTOM_RINGTONE:kotlin.String)instead.                                                                                                                                                                                                                                                                                  |
| int    | [SEND_TO_VOICEMAIL](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#SEND_TO_VOICEMAIL:kotlin.String) | read/write      | An indicator of whether calls from this raw contact should be forwarded directly to voice mail ('1') or not ('0'). To have an effect on the corresponding value of the aggregate contact, this field should be set at the time the raw contact is inserted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| String | [ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME:kotlin.String)                     | read/write-once | The name of the account instance to which this row belongs, which when paired with[ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String)identifies a specific account. For example, this will be the Gmail address if it is a Google account. It should be set at the time the raw contact is inserted and never changed afterwards.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| String | [ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String)                     | read/write-once | The type of account to which this row belongs, which when paired with[ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME:kotlin.String)identifies a specific account. It should be set at the time the raw contact is inserted and never changed afterwards. To ensure uniqueness, new account types should be chosen according to the Java package naming convention. Thus a Google account is of type "com.google".                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| String | [DATA_SET](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#DATA_SET:kotlin.String)                      | read/write-once | The data set within the account that this row belongs to. This allows multiple sync adapters for the same account type to distinguish between each others' data. The combination of[ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String),[ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME:kotlin.String), and[DATA_SET](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#DATA_SET:kotlin.String)identifies a set of data that is associated with a single sync adapter. This is empty by default, and is completely optional. It only needs to be populated if multiple sync adapters are entering distinct data for the same account type and account name. It should be set at the time the raw contact is inserted and never changed afterwards. |
| String | [SOURCE_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#SOURCE_ID:kotlin.String)                           | read/write      | String that uniquely identifies this row to its source account. Typically it is set at the time the raw contact is inserted and never changed afterwards. The one notable exception is a new raw contact: it will have an account name and type (and possibly a data set), but no source id. This indicates to the sync adapter that a new contact needs to be created server-side and its ID stored in the corresponding SOURCE_ID field on the phone.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| int    | [VERSION](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#VERSION:kotlin.String)                               | read-only       | Version number that is updated whenever this row or its related data changes. This field can be used for optimistic locking of a raw contact.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| int    | [DIRTY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#DIRTY:kotlin.String)                                   | read/write      | Flag indicating that[VERSION](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#VERSION:kotlin.String)has changed, and this row needs to be synchronized by its owning account. The value is set to "1" automatically whenever the raw contact changes, unless the URI has the[ContactsContract.CALLER_IS_SYNCADAPTER](https://developer.android.com/reference/kotlin/android/provider/ContactsContract#CALLER_IS_SYNCADAPTER:kotlin.String)query parameter specified. The sync adapter should always supply this query parameter to prevent unnecessary synchronization: user changes some data on the server, the sync adapter updates the contact on the phone (without the CALLER_IS_SYNCADAPTER flag) flag, which sets the DIRTY flag, which triggers a sync to bring the changes to the server.                                                                                                                 |
| String | [SYNC1](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC1:kotlin.String)                               | read/write      | Generic column provided for arbitrary use by sync adapters. The content provider stores this information on behalf of the sync adapter but does not interpret it in any way.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| String | [SYNC2](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC2:kotlin.String)                               | read/write      | Generic column for use by sync adapters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| String | [SYNC3](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC3:kotlin.String)                               | read/write      | Generic column for use by sync adapters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| String | [SYNC4](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC4:kotlin.String)                               | read/write      | Generic column for use by sync adapters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

## Summary

|                                                                                                                                            Nested classes                                                                                                                                            ||
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Data](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts.Data) A sub-directory of a single raw contact that contains all of its[ContactsContract.Data](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Data)rows.     |
|   | [DefaultAccount](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts.DefaultAccount) Class containing utility methods around the default account.                                                                                                        |
|   | [DisplayPhoto](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts.DisplayPhoto) A sub-directory of a single raw contact that represents its primary display photo.                                                                                      |
|   | [Entity](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts.Entity) A sub-directory of a single raw contact that contains all of its[ContactsContract.Data](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Data)rows. |

|                                                                                                                                                                                                                                            Constants                                                                                                                                                                                                                                            ||
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [AGGREGATION_MODE_DEFAULT](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_DEFAULT:kotlin.Int) Aggregation mode: aggregate immediately after insert or update operation(s) are complete.                                                                                                                                                  |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [AGGREGATION_MODE_DISABLED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_DISABLED:kotlin.Int) Aggregation mode: never aggregate this raw contact.                                                                                                                                                                                      |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [AGGREGATION_MODE_IMMEDIATE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_IMMEDIATE:kotlin.Int) Aggregation mode: aggregate at the time the raw contact is inserted/updated.                                                                                                                                                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [AGGREGATION_MODE_SUSPENDED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_SUSPENDED:kotlin.Int) Aggregation mode: aggregation suspended temporarily, and is likely to be resumed later.                                                                                                                                                |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTENT_ITEM_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#CONTENT_ITEM_TYPE:kotlin.String) The MIME type of the results when a raw contact ID is appended to[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#CONTENT_URI:android.net.Uri), yielding a subdirectory of a single person. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTENT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#CONTENT_TYPE:kotlin.String) The MIME type of the results from[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#CONTENT_URI:android.net.Uri)when a specific ID value is not provided, and multiple raw contacts may be returned.    |

| Inherited constants ||
|---|---|
| From class[SyncColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME:kotlin.String) <br /> The name of the account instance to which this row belongs, which when paired with[ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String)identifies a specific account. Type: TEXT <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String) <br /> The type of account to which this row belongs, which when paired with[ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME:kotlin.String)identifies a specific account. Type: TEXT <br />              | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DIRTY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#DIRTY:kotlin.String) <br /> Flag indicating that[VERSION](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#VERSION:kotlin.String)has changed, and this row needs to be synchronized by its owning account. Type: INTEGER (boolean) <br />                               | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SOURCE_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#SOURCE_ID:kotlin.String) <br /> String that uniquely identifies this row to its source account. Type: TEXT <br />                                                                                                                                                                                               | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [VERSION](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#VERSION:kotlin.String) <br /> Version number that is updated whenever this row or its related data changes. Type: INTEGER <br />                                                                                                                                                                                  | ||
| From class[RawContactsColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_TYPE_AND_DATA_SET](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#ACCOUNT_TYPE_AND_DATA_SET:kotlin.String) <br /> A concatenation of the account type and data set (delimited by a forward slash) - if the data set is empty, this will be the same as the account type. For applications that need to be aware of the data set, this can be used instead of account type to distinguish sets of data. This is never intended to be used for specifying accounts. This column does \*not\* escape forward slashes in the account type or the data set. If this is an issue, consider using[ContactsContract.RawContacts.ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String)and[ContactsContract.RawContacts.DATA_SET](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#DATA_SET:kotlin.String)directly. <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [AGGREGATION_MODE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#AGGREGATION_MODE:kotlin.String) <br /> The aggregation mode for this contact. Type: INTEGER <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [BACKUP_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#BACKUP_ID:kotlin.String) <br /> Persistent unique id for each raw_contact within its account. This id is provided by its own data source, and can be used to backup metadata to the server. This should be unique within each set of account_name/account_type/data_set <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#CONTACT_ID:kotlin.String) <br /> A reference to the[ContactsContract.Contacts._ID](https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_ID:kotlin.String)that this data belongs to. Type: INTEGER <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DATA_SET](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#DATA_SET:kotlin.String) <br /> The data set within the account that this row belongs to. This allows multiple sync adapters for the same account type to distinguish between each others' data. This is empty by default, and is completely optional. It only needs to be populated if multiple sync adapters are entering distinct data for the same account type and account name. Type: TEXT <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DELETED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#DELETED:kotlin.String) <br /> The "deleted" flag: "0" by default, "1" if the row has been marked for deletion. When android.content.ContentResolver#delete is called on a raw contact, it is marked for deletion and removed from its aggregate contact. The sync adaptor deletes the raw contact on the server and then calls ContactResolver.delete once more, this time passing the[ContactsContract.CALLER_IS_SYNCADAPTER](https://developer.android.com/reference/kotlin/android/provider/ContactsContract#CALLER_IS_SYNCADAPTER:kotlin.String)query parameter to finalize the data removal. Type: INTEGER <br />                                                                                                                                                                                                                                                                               | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [METADATA_DIRTY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#METADATA_DIRTY:kotlin.String) <br /> Flag indicating that a raw contact's metadata has changed, and its metadata needs to be synchronized by the server. Type: INTEGER (boolean) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [RAW_CONTACT_IS_READ_ONLY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#RAW_CONTACT_IS_READ_ONLY:kotlin.String) <br /> The "read-only" flag: "0" by default, "1" if the row cannot be modified or deleted except by a sync adapter. See[ContactsContract.CALLER_IS_SYNCADAPTER](https://developer.android.com/reference/kotlin/android/provider/ContactsContract#CALLER_IS_SYNCADAPTER:kotlin.String). Type: INTEGER <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [RAW_CONTACT_IS_USER_PROFILE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#RAW_CONTACT_IS_USER_PROFILE:kotlin.String) <br /> Flag that reflects whether this raw contact belongs to the user's personal profile entry. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | ||
| From class[ContactOptionsColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns) |----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CUSTOM_RINGTONE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#CUSTOM_RINGTONE:kotlin.String) <br /> URI for a custom ringtone associated with the contact. If null or missing, the default ringtone is used. Type: TEXT (URI to the ringtone) <br />                                                                                                                                                                                                            | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LAST_TIME_CONTACTED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#LAST_TIME_CONTACTED:kotlin.String) <br /> The last time a contact was contacted. **Caution:** If you publish your app to the Google Play Store, this field is obsolete, regardless of Android version. For more information, see the[Contacts Provider](https://developer.android.com/reference/kotlin/guide/topics/providers/contacts-provider#ObsoleteData)page. Type: INTEGER <br />       | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PINNED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#PINNED:kotlin.String) <br /> The position at which the contact is pinned. If[PinnedPositions.UNPINNED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.PinnedPositions#UNPINNED:kotlin.Int), the contact is not pinned. Also see[PinnedPositions](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.PinnedPositions). Type: INTEGER <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SEND_TO_VOICEMAIL](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#SEND_TO_VOICEMAIL:kotlin.String) <br /> Whether the contact should always be sent to voicemail. If missing, defaults to false. Type: INTEGER (0 for false, 1 for true) <br />                                                                                                                                                                                                                   | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [STARRED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#STARRED:kotlin.String) <br /> Is the contact starred? Type: INTEGER (boolean) <br />                                                                                                                                                                                                                                                                                                                      | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [TIMES_CONTACTED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#TIMES_CONTACTED:kotlin.String) <br /> The number of times a contact has been contacted. **Caution:** If you publish your app to the Google Play Store, this field is obsolete, regardless of Android version. For more information, see the[Contacts Provider](https://developer.android.com/reference/kotlin/guide/topics/providers/contacts-provider#ObsoleteData)page. Type: INTEGER <br />    | ||
| From class[ContactNameColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns) |----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DISPLAY_NAME_ALTERNATIVE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#DISPLAY_NAME_ALTERNATIVE:kotlin.String) <br /> An alternative representation of the display name, such as "family name first" instead of "given name first" for Western names. If an alternative is not available, the values should be the same as[DISPLAY_NAME_PRIMARY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#DISPLAY_NAME_PRIMARY:kotlin.String). A contacts provider is free to provide alternatives as necessary for its target market. For example the default Android Open Source Project contacts provider currently provides an alternative in a single case: if the display name is based on the structured name and the structured name follows the Western full name style, then the field contains the "family name first" version of the full name. Other cases may be added later. <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DISPLAY_NAME_PRIMARY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#DISPLAY_NAME_PRIMARY:kotlin.String) <br /> The standard text shown as the contact's display name, based on the best available information for the contact (for example, it might be the email address if the name is not available). The information actually used to compute the name is stored in[DISPLAY_NAME_SOURCE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#DISPLAY_NAME_SOURCE:kotlin.String). A contacts provider is free to choose whatever representation makes most sense for its target market. For example in the default Android Open Source Project implementation, if the display name is based on the structured name and the structured name follows the Western full-name style, then this field contains the "given name first" version of the full name. <br /> <br />                     | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DISPLAY_NAME_SOURCE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#DISPLAY_NAME_SOURCE:kotlin.String) <br /> The kind of data that is used as the display name for the contact, such as structured name or email address. See[DisplayNameSources](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayNameSources). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PHONETIC_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#PHONETIC_NAME:kotlin.String) <br /> Pronunciation of the full name in the phonetic alphabet specified by[PHONETIC_NAME_STYLE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#PHONETIC_NAME_STYLE:kotlin.String). The value may be set manually by the user. This capability is of interest only in countries with commonly used phonetic alphabets, such as Japan and Korea. See[PhoneticNameStyle](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.PhoneticNameStyle). <br />                                                                                                                                                                                                                                                                                                              | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PHONETIC_NAME_STYLE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#PHONETIC_NAME_STYLE:kotlin.String) <br /> The phonetic alphabet used to represent the[PHONETIC_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#PHONETIC_NAME:kotlin.String). See[PhoneticNameStyle](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.PhoneticNameStyle). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SORT_KEY_ALTERNATIVE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#SORT_KEY_ALTERNATIVE:kotlin.String) <br /> Sort key based on the alternative representation of the full name,[DISPLAY_NAME_ALTERNATIVE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#DISPLAY_NAME_ALTERNATIVE:kotlin.String). Thus for Western names, it is the one using the "family name first" format. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SORT_KEY_PRIMARY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#SORT_KEY_PRIMARY:kotlin.String) <br /> Sort key that takes into account locale-based traditions for sorting names in address books. The default sort key is[DISPLAY_NAME_PRIMARY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactNameColumns#DISPLAY_NAME_PRIMARY:kotlin.String). For Chinese names the sort key is the name's Pinyin spelling, and for Japanese names it is the Hiragana version of the phonetic name. <br />                                                                                                                                                                                                                                                                                                                                                                                                        | ||
| From class[BaseSyncColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SYNC1](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC1:kotlin.String) <br /> Generic column for use by sync adapters. <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SYNC2](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC2:kotlin.String) <br /> Generic column for use by sync adapters. <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SYNC3](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC3:kotlin.String) <br /> Generic column for use by sync adapters. <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SYNC4](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.BaseSyncColumns#SYNC4:kotlin.String) <br /> Generic column for use by sync adapters. <br /> | ||
| From class[BaseColumns](https://developer.android.com/reference/kotlin/android/provider/BaseColumns) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [_COUNT](https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_COUNT:kotlin.String) <br /> The count of rows in a directory. Type: INTEGER <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [_ID](https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_ID:kotlin.String) <br /> The unique ID for a row. Type: INTEGER (long) <br />         | ||

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ||
|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!                           | [getContactLookupUri](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#getContactLookupUri(android.content.ContentResolver,%20android.net.Uri))`(`resolver:` `[ContentResolver](https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#)!`, `rawContactUri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!`)` Build a[android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts#CONTENT_LOOKUP_URI:android.net.Uri)style[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)for the parent[android.provider.ContactsContract.Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)entry of the given[RawContacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#)entry. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?                      | [getLocalAccountName](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#getLocalAccountName(android.content.Context))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)`)` The default value used for[ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME:kotlin.String)of raw contacts when they are inserted without a value for this column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?                      | [getLocalAccountType](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#getLocalAccountType(android.content.Context))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)`)` The default value used for[ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String)of raw contacts when they are inserted without a value for this column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| static[EntityIterator](https://developer.android.com/reference/kotlin/android/content/EntityIterator.html#)! | [newEntityIterator](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#newEntityIterator(android.database.Cursor))`(`cursor:` `[Cursor](https://developer.android.com/reference/kotlin/android/database/Cursor.html#)!`)` TODO: javadoc                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

|                                                                                                                                                                      Properties                                                                                                                                                                      ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | [CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#CONTENT_URI:android.net.Uri) The content:// style URI for this table, which requests a directory of raw contact rows matching the selection criteria. |

## Constants

### AGGREGATION_MODE_DEFAULT

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val AGGREGATION_MODE_DEFAULT: Int
```

Aggregation mode: aggregate immediately after insert or update operation(s) are complete.  

    Value: 0

### AGGREGATION_MODE_DISABLED

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val AGGREGATION_MODE_DISABLED: Int
```

Aggregation mode: never aggregate this raw contact. The raw contact will not have a corresponding[Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)aggregate and therefore will not be included in[Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)query results.

For example, this mode can be used for a raw contact that is marked for deletion while waiting for the deletion to occur on the server side.  

    Value: 3

**See Also**

- [#AGGREGATION_MODE_SUSPENDED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_SUSPENDED:kotlin.Int)  

### AGGREGATION_MODE_IMMEDIATE

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val AGGREGATION_MODE_IMMEDIATE: Int
```

**Deprecated:** *Aggregation is synchronous, this historic value is a no-op*

Aggregation mode: aggregate at the time the raw contact is inserted/updated.  

    Value: 1

### AGGREGATION_MODE_SUSPENDED

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val AGGREGATION_MODE_SUSPENDED: Int
```

Aggregation mode: aggregation suspended temporarily, and is likely to be resumed later. Changes to the raw contact will update the associated aggregate contact but will not result in any change in how the contact is aggregated. Similar to[AGGREGATION_MODE_DISABLED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_DISABLED:kotlin.Int), but maintains a link to the corresponding[Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)aggregate.

This can be used to postpone aggregation until after a series of updates, for better performance and/or user experience.

Note that changing[AGGREGATION_MODE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContactsColumns#AGGREGATION_MODE:kotlin.String)from[AGGREGATION_MODE_SUSPENDED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_SUSPENDED:kotlin.Int)to[AGGREGATION_MODE_DEFAULT](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#AGGREGATION_MODE_DEFAULT:kotlin.Int)does not trigger an aggregation pass, but any subsequent change to the raw contact's data will.  

    Value: 2

### CONTENT_ITEM_TYPE

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CONTENT_ITEM_TYPE: String
```

The MIME type of the results when a raw contact ID is appended to[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#CONTENT_URI:android.net.Uri), yielding a subdirectory of a single person.  

    Value: "vnd.android.cursor.item/raw_contact"

### CONTENT_TYPE

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CONTENT_TYPE: String
```

The MIME type of the results from[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#CONTENT_URI:android.net.Uri)when a specific ID value is not provided, and multiple raw contacts may be returned.  

    Value: "vnd.android.cursor.dir/raw_contact"

## Public methods

### getContactLookupUri

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun getContactLookupUri(
    resolver: ContentResolver!, 
    rawContactUri: Uri!
): Uri!
```

Build a[android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts#CONTENT_LOOKUP_URI:android.net.Uri)style[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)for the parent[android.provider.ContactsContract.Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)entry of the given[RawContacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#)entry.  

### getLocalAccountName

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun getLocalAccountName(context: Context): String?
```

The default value used for[ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME:kotlin.String)of raw contacts when they are inserted without a value for this column.

This account is used to identify contacts that are only stored locally in the contacts database instead of being associated with an[Account](https://developer.android.com/reference/kotlin/android/accounts/Account.html#)managed by an installed application.

When this returns null then[getLocalAccountType](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#getLocalAccountType(android.content.Context))will also return null and when it is non-null[getLocalAccountType](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#getLocalAccountType(android.content.Context))will also return a non-null value.

|                                                           Parameters                                                           ||
|-----------|---------------------------------------------------------------------------------------------------------------------|
| `context` | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#):This value cannot be`null`. |

### getLocalAccountType

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun getLocalAccountType(context: Context): String?
```

The default value used for[ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE:kotlin.String)of raw contacts when they are inserted without a value for this column.

This account is used to identify contacts that are only stored locally in the contacts database instead of being associated with an[Account](https://developer.android.com/reference/kotlin/android/accounts/Account.html#)managed by an installed application.

When this returns null then[getLocalAccountName](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#getLocalAccountName(android.content.Context))will also return null and when it is non-null[getLocalAccountName](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.RawContacts#getLocalAccountName(android.content.Context))will also return a non-null value.

|                                                           Parameters                                                           ||
|-----------|---------------------------------------------------------------------------------------------------------------------|
| `context` | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#):This value cannot be`null`. |

### newEntityIterator

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun newEntityIterator(cursor: Cursor!): EntityIterator!
```

TODO: javadoc

|                                             Parameters                                             ||
|----------|------------------------------------------------------------------------------------------|
| `cursor` | [Cursor](https://developer.android.com/reference/kotlin/android/database/Cursor.html#)!: |

|                                                  Return                                                   ||
|--------------------------------------------------------------------------------------------------------|---|
| [EntityIterator](https://developer.android.com/reference/kotlin/android/content/EntityIterator.html#)! |   |

## Properties

### CONTENT_URI

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CONTENT_URI: Uri!
```

The content:// style URI for this table, which requests a directory of raw contact rows matching the selection criteria.