Session


class Session : BaseColumns
kotlin.Any
   ↳ 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 ContactsContract.Data table, providing secure, one-time access to the EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS 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 android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION. Privileged system applications with MANAGE_CONTACTS_PICKER_SESSION permission can still access all session data.

Because a session URI projects data from ContactsContract.Data, clients can use the columns from ContactsContract.Data in their query projection, selection, and sort order, just as they would when querying ContactsContract.Data directly.

Summary

Constants
static String

The MIME type for a directory of contact data items within a specific session.

Inherited constants
Properties
static Uri

The base content:// style Uri for this table.

Constants

CONTENT_TYPE

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

static val CONTENT_URI: Uri

The base content:// style Uri 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 android.app.Activity#onActivityResult(int,int,android.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.