Builder


class Builder
kotlin.Any
   ↳ android.provider.PeopleContract.Persons.Query.Builder

Helper class for building structured query argument bundles to pass into ContentResolver.query(Uri,String[],Bundle,CancellationSignal) when querying Persons.CONTENT_URI.

Multiple sub-queries targeting different directory packages or selection criteria can be combined onto a single builder instance before calling build().

Summary

Public constructors

Constructs a new empty instance of Builder.

Public methods
PeopleContract.Persons.Query.Builder
addEmailQuery(packageName: String, emailAddresses: MutableList<String!>)

Adds a sub-query searching for person records that match the given list of email addresses within the specified directory package.

PeopleContract.Persons.Query.Builder
addGroupQuery(packageName: String, groupLookupKeys: MutableList<String!>)

Adds a sub-query searching for person records that are members of groups matching the given list of group lookup keys within the specified directory package.

PeopleContract.Persons.Query.Builder
addLookupQuery(packageName: String, lookupKeys: MutableList<String!>)

Adds a sub-query searching for specific person records matching the given list of opaque lookup keys within the specified directory package.

PeopleContract.Persons.Query.Builder
addPhoneQuery(packageName: String, phones: MutableList<String!>)

Adds a sub-query searching for person records that match the given list of phone numbers within the specified directory package.

Bundle

Generates the final query arguments Bundle containing all configured sub-queries.

Public constructors

Builder

Builder()

Constructs a new empty instance of Builder.

Public methods

addEmailQuery

fun addEmailQuery(
    packageName: String,
    emailAddresses: MutableList<String!>
): PeopleContract.Persons.Query.Builder

Adds a sub-query searching for person records that match the given list of email addresses within the specified directory package.

Parameters
packageName String: The package name of the target directory application.
This value cannot be null.
emailAddresses MutableList<String!>: A list of email address strings to search for.
This value cannot be null.
Return
PeopleContract.Persons.Query.Builder This builder instance for method chaining.
This value cannot be null.

addGroupQuery

fun addGroupQuery(
    packageName: String,
    groupLookupKeys: MutableList<String!>
): PeopleContract.Persons.Query.Builder

Adds a sub-query searching for person records that are members of groups matching the given list of group lookup keys within the specified directory package.

Parameters
packageName String: The package name of the target directory application.
This value cannot be null.
groupLookupKeys MutableList<String!>: A list of group lookup key strings to search within.
This value cannot be null.
Return
PeopleContract.Persons.Query.Builder This builder instance for method chaining.
This value cannot be null.

addLookupQuery

fun addLookupQuery(
    packageName: String,
    lookupKeys: MutableList<String!>
): PeopleContract.Persons.Query.Builder

Adds a sub-query searching for specific person records matching the given list of opaque lookup keys within the specified directory package.

Parameters
packageName String: The package name of the target directory application.
This value cannot be null.
lookupKeys MutableList<String!>: A list of person lookup key strings to resolve.
This value cannot be null.
Return
PeopleContract.Persons.Query.Builder This builder instance for method chaining.
This value cannot be null.

addPhoneQuery

fun addPhoneQuery(
    packageName: String,
    phones: MutableList<String!>
): PeopleContract.Persons.Query.Builder

Adds a sub-query searching for person records that match the given list of phone numbers within the specified directory package.

Parameters
packageName String: The package name of the target directory application.
This value cannot be null.
phones MutableList<String!>: A list of phone number strings to search for. Required to be in E.164 standard format.
This value cannot be null.
Return
PeopleContract.Persons.Query.Builder This builder instance for method chaining.
This value cannot be null.

build

fun build(): Bundle

Generates the final query arguments Bundle containing all configured sub-queries.

The returned bundle can be passed directly as the query arguments parameter to ContentResolver.query(Uri,String[],Bundle,CancellationSignal).

Return
Bundle A Bundle containing the accumulated query requests under QUERY_ARG_QUERIES.
This value cannot be null.