Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Constants](https://developer.android.com/reference/android/provider/PeopleContract.Directory#constants) \| [Fields](https://developer.android.com/reference/android/provider/PeopleContract.Directory#lfields) \| [Methods](https://developer.android.com/reference/android/provider/PeopleContract.Directory#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/provider/PeopleContract.Directory#inhmethods)

# PeopleContract.Directory

*** ** * ** ***


`
public
static
final

class
PeopleContract.Directory
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.PeopleContract.Directory |

<br />

*** ** * ** ***

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/android/provider/PeopleContract`.

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

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/PeopleContract.Directory#CONTENT_ITEM_TYPE` The MIME type of a `https://developer.android.com/reference/android/provider/PeopleContract.Directory#CONTENT_URI` subdirectory of a single People Directory. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/PeopleContract.Directory#CONTENT_TYPE` The MIME type of `https://developer.android.com/reference/android/provider/PeopleContract.Directory#CONTENT_URI` providing a directory of People Directories. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/PeopleContract.Directory#DIRECTORY_AUTHORITY` Column name for the authority of the People Directory application. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/PeopleContract.Directory#DIRECTORY_PROPERTY` Manifest property name that a `https://developer.android.com/reference/android/content/ContentProvider` must define in a `<property>` tag within its manifest declaration to register itself as a People Directory with the system. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/PeopleContract.Directory#PACKAGE_NAME` Column name for the package name of the application providing the People Directory. |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/net/Uri` | `https://developer.android.com/reference/android/provider/PeopleContract.Directory#CONTENT_URI` The content:// style URI for querying the list of registered People Directories. |

| ### Public methods ||
|---|---|
| ` static boolean` | ` https://developer.android.com/reference/android/provider/PeopleContract.Directory#notifyChange(android.content.Context,%20android.net.Uri,%20android.os.Bundle,%20android.os.CancellationSignal)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/android/os/Bundle queryArgs, https://developer.android.com/reference/android/os/CancellationSignal cancellationSignal) ` 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://developer.android.com/reference/android/provider/PeopleContract.Directory#requestRefresh(android.content.Context,%20android.os.CancellationSignal)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/os/CancellationSignal cancellationSignal) ` Requests the system to refresh records in the local database across all registered People Directories. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Constants

### CONTENT_ITEM_TYPE

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String CONTENT_ITEM_TYPE
```

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

<br />

Constant Value:

"vnd.android.cursor.item/people_directory"


### CONTENT_TYPE

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String CONTENT_TYPE
```

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

<br />

Constant Value:

"vnd.android.cursor.dir/people_directories"


### DIRECTORY_AUTHORITY

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String DIRECTORY_AUTHORITY
```

Column name for the authority of the People Directory application.

Type: TEXT

<br />

Constant Value:

"authority"


### DIRECTORY_PROPERTY

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String DIRECTORY_PROPERTY
```

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

<br />

Constant Value:

"android.content.PeopleDirectory"


### PACKAGE_NAME

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String PACKAGE_NAME
```

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

Type: TEXT

<br />

Constant Value:

"package_name"


## Fields

### CONTENT_URI

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final Uri CONTENT_URI
```

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

<br />

## Public methods

### notifyChange

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static boolean notifyChange (Context context, 
                Uri uri, 
                Bundle queryArgs, 
                CancellationSignal cancellationSignal)
```

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/android/database/ContentObserver` registered on `https://developer.android.com/reference/android/provider/PeopleContract#CONTENT_NOTIFICATION_URI` or query-specific notification URIs.

<br />

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

| Returns ||
|---|---|
| `boolean` | `true` if the change notification was sent and refresh initiated, `false` if the calling package is not a registered People Directory. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `uri` or `queryArgs` are null, or if `uri` or `queryArgs` contain invalid arguments. |

### requestRefresh

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static boolean requestRefresh (Context context, 
                CancellationSignal cancellationSignal)
```

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/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.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: The `https://developer.android.com/reference/android/content/Context` used to access the `https://developer.android.com/reference/android/content/ContentResolver`. This value cannot be `null`. <br /> |
| `cancellationSignal` | `CancellationSignal`: An optional `https://developer.android.com/reference/android/os/CancellationSignal` to cancel the refresh request, or `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `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. <br /> |