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

# Directory

*** ** * ** ***

```
class Directory
```

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

Constants and utilities for registering and discovering People Directories.

A People Directory is an application (such as a VoIP calling or chat messaging service) that provides person and group identity definitions to the system.

**For People Directory applications:** To implement a People Directory, see "Implementing a People Directory" in `https://developer.android.com/reference/kotlin/android/provider/PeopleContract`.

**For client applications:** Clients can query `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_URI:android.net.Uri` to discover all registered and active directory applications currently installed on the device.

## Summary

| Constants ||
|---|---|
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_ITEM_TYPE:kotlin.String` The MIME type of a `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_URI:android.net.Uri` subdirectory of a single People Directory. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_TYPE:kotlin.String` The MIME type of `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_URI:android.net.Uri` providing a directory of People Directories. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#DIRECTORY_AUTHORITY:kotlin.String` Column name for the authority of the People Directory application. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#DIRECTORY_PROPERTY:kotlin.String` Manifest property name that a `https://developer.android.com/reference/kotlin/android/content/ContentProvider.html#` must define in a `<property>` tag within its manifest declaration to register itself as a People Directory with the system. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#PACKAGE_NAME:kotlin.String` Column name for the package name of the application providing the People Directory. |

| Public methods ||
|---|---|
| static [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#notifyChange(android.content.Context,%20android.net.Uri,%20android.os.Bundle,%20android.os.CancellationSignal)(context: https://developer.android.com/reference/kotlin/android/content/Context.html#, uri: https://developer.android.com/reference/kotlin/android/net/Uri.html#, queryArgs: https://developer.android.com/reference/kotlin/android/os/Bundle.html#?, cancellationSignal: https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#?)` Notifies the People Provider that specific records within a directory have changed, enqueuing a debounced targeted maintenance job to update the local database and notify observing client applications. |
| static [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#requestRefresh(android.content.Context,%20android.os.CancellationSignal)(context: https://developer.android.com/reference/kotlin/android/content/Context.html#, cancellationSignal: https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#?)` Requests the system to refresh records in the local database across all registered People Directories. |

| Properties ||
|---|---|
| static [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#) | `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_URI:android.net.Uri` The content:// style URI for querying the list of registered People Directories. |

## Constants

### CONTENT_ITEM_TYPE

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

```
static val CONTENT_ITEM_TYPE: String
```

The MIME type of a `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_URI:android.net.Uri` subdirectory of a single People Directory.

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

### CONTENT_TYPE

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

```
static val CONTENT_TYPE: String
```

The MIME type of `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#CONTENT_URI:android.net.Uri` providing a directory of People Directories.

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

### DIRECTORY_AUTHORITY

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

```
static val DIRECTORY_AUTHORITY: String
```

Column name for the authority of the People Directory application.

Type: TEXT

    Value: "authority"

### DIRECTORY_PROPERTY

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

```
static val DIRECTORY_PROPERTY: String
```

Manifest property name that a `https://developer.android.com/reference/kotlin/android/content/ContentProvider.html#` must define in a `<property>` tag within its manifest declaration to register itself as a People Directory with the system.

    Value: "android.content.PeopleDirectory"

### PACKAGE_NAME

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

```
static val PACKAGE_NAME: String
```

Column name for the package name of the application providing the People Directory.

Type: TEXT

    Value: "package_name"

## Public methods

### notifyChange

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

```
static fun notifyChange(
    context: Context, 
    uri: Uri, 
    queryArgs: Bundle?, 
    cancellationSignal: CancellationSignal?
): Boolean
```

Notifies the People Provider that specific records within a directory have changed, enqueuing a debounced targeted maintenance job to update the local database and notify observing client applications.

**For People Directory applications:** People Directory applications should invoke this method whenever a person or group record is added, updated, or removed. This method must be invoked by the application package that owns the directory provider. Specifying the exact URI and matching query arguments allows the system to efficiently update its local database and backfill data for interested clients.

**For client applications:** Clients do not invoke this method. When a People Directory application calls this method, the system refreshes local database entries and notifies any `https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#` registered on `https://developer.android.com/reference/kotlin/android/provider/PeopleContract#CONTENT_NOTIFICATION_URI:android.net.Uri` or query-specific notification URIs.

| Parameters ||
|---|---|
| `context` | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#): The `https://developer.android.com/reference/kotlin/android/content/Context.html#` used to access the `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#`. This value cannot be `null`. |
| `uri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#): The URI corresponding to the modified data (for example, `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Persons#CONTENT_URI:android.net.Uri` or `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Groups#CONTENT_URI:android.net.Uri`). This value cannot be `null`. |
| `queryArgs` | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)?: A query arguments `https://developer.android.com/reference/kotlin/android/os/Bundle.html#` constructed using `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Persons.Query.Builder` or `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Groups.Query.Builder` containing selection criteria that match the modified data records. This value may be `null`. |
| `cancellationSignal` | [CancellationSignal](https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#)?: An optional `https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#` to cancel the refresh operation, or `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `true` if the change notification was sent and refresh initiated, `false` if the calling package is not a registered People Directory. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if `uri` or `queryArgs` are null, or if `uri` or `queryArgs` contain invalid arguments. |

### requestRefresh

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

```
static fun requestRefresh(
    context: Context, 
    cancellationSignal: CancellationSignal?
): Boolean
```

Requests the system to refresh records in the local database across all registered People Directories.

**For People Directory applications:** People Directory applications can call this method after significant, large-scale state changes (such as completing an initial account synchronization or resetting database storage) to prompt the system to schedule a package-level refresh job to rebuild directory records in its local database. This method must be invoked by the application package that owns the directory provider.

This method is an expensive operation and should not be used as a general alternative to `https://developer.android.com/reference/kotlin/android/provider/PeopleContract.Directory#notifyChange(android.content.Context,%20android.net.Uri,%20android.os.Bundle,%20android.os.CancellationSignal)` for incremental changes.

Note that this request acts as a hint to the system; the exact timing and execution of database updates depend on system conditions such as available memory and overall device state, and immediate execution is not guaranteed.

**For client applications:** Clients do not invoke this method.

| Parameters ||
|---|---|
| `context` | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#): The `https://developer.android.com/reference/kotlin/android/content/Context.html#` used to access the `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#`. This value cannot be `null`. |
| `cancellationSignal` | [CancellationSignal](https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#)?: An optional `https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#` to cancel the refresh request, or `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `true` if the refresh request was successfully accepted, `false` if the calling package is not a registered People Directory or the request could not be processed. |

## Properties

### CONTENT_URI

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

```
static val CONTENT_URI: Uri
```

The content:// style URI for querying the list of registered People Directories.