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

# Session

*** ** * ** ***

```
class Session : BaseColumns
```

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

Defines the contract for a Contacts Picker session, which represents the set of contacts selected by the user in a single picking operation.

Each row in this table corresponds to a single picker session and acts as a pointer to the underlying contact data. Querying a session URI effectively projects rows from the `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Data` table, providing secure, one-time access to the `https://developer.android.com/reference/kotlin/android/provider/ContactsPickerSessionContract#EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS:kotlin.String` for the contacts that the user selected.

Access to session data is strictly controlled for privacy and security. A client application can only access the session it initiated using the specific session URI returned by the picker. This access is enforced through `https://developer.android.com/reference/kotlin/android/content/Intent.html#FLAG_GRANT_READ_URI_PERMISSION:kotlin.Int`. Privileged system applications with `MANAGE_CONTACTS_PICKER_SESSION` permission can still access all session data.

Because a session URI projects data from `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Data`, clients can use the columns from `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Data` in their query projection and sort order, just as they would when querying `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Data` directly.

Clients are not expected to pass selection and selection arguments in this query, as the data is already selected by the human user. Throws `https://developer.android.com/reference/kotlin/java/lang/UnsupportedOperationException.html#` when either selection or selection arguments are passed.

## Summary

| Constants ||
|---|---|
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsPickerSessionContract.Session#CONTENT_TYPE:kotlin.String` The MIME type for a directory of contact data items within a specific session. |

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/provider/BaseColumns` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_COUNT:kotlin.String` The count of rows in a directory. Type: INTEGER <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_ID:kotlin.String` The unique ID for a row. Type: INTEGER (long) <br /> | ||

| Properties ||
|---|---|
| static [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#) | `https://developer.android.com/reference/kotlin/android/provider/ContactsPickerSessionContract.Session#CONTENT_URI:android.net.Uri` The base `content://` style `https://developer.android.com/reference/kotlin/android/net/Uri.html#` for this table. |

## Constants

### CONTENT_TYPE

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

```
static val CONTENT_TYPE: String
```

The MIME type for a directory of contact data items within a specific session. A session URI, whether for a single session (e.g., `CONTENT_URI/<session_id>`) or for the base URI, will have this MIME type.

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

## Properties

### CONTENT_URI

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

```
static val CONTENT_URI: Uri
```

The base `content://` style `https://developer.android.com/reference/kotlin/android/net/Uri.html#` for this table.

This URI represents the collection of all picker sessions and cannot be queried directly. To access data for a specific session, clients must use the unique session URI returned by the Contacts Picker in `https://developer.android.com/reference/kotlin/android/app/Activity.html#onActivityResult(kotlin.Int,%20kotlin.Int,%20android.content.Intent)`. This returned URI will have the format `content://<AUTHORITY>/sessions/<session_id>`, where `<session_id>` is a unique identifier for the picking operation.