GlobalSearchApplicationInfo


@ExperimentalAppSearchApi
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.VERBATIM_SEARCH)
@Document(name = "builtin:GlobalSearchApplicationInfo")
public final class GlobalSearchApplicationInfo


An indexable document class which indicates that an app is capable of producing, or capable of consuming, certain AppSearch schema types.

This class represents optional metadata about an app's data interchange, and is not part of the schema.org types that model object schemas.

A producer can check for the existence of ready consumers by querying for GlobalSearchApplicationInfo documents that ask for a type that producer produces. Once a matching androidx.appsearch.app.SearchResult is retrieved, the producer can set a schema with access permissions granted to the package that owns this GlobalSearchApplicationInfo and index documents of that type.

The package name of the app which is producing or consuming data is not part of this class -- it can be obtained from getPackageName.

Summary

Nested types

Builder class for GlobalSearchApplicationInfo.

Constants

static final int

Used with #mApplicationType to indicate this application is able and interested in querying a certain type of data.

static final int

Used with #mApplicationType to indicate this application is ready and able to index a certain type of data.

Public methods

int

Returns whether this app is interested in either producing or consuming the schema types listed in getSchemaTypes.

@NonNull String

Returns the unique identifier for this GlobalSearchApplicationInfo.

@NonNull String

Returns the namespace (or logical grouping) for this GlobalSearchApplicationInfo.

@NonNull List<@NonNull String>

Returns the list of schema type names this app is capable of producing (if getApplicationType is APPLICATION_TYPE_PRODUCER) or interested in consuming (if is #APPLICATION_TYPE_CONSUMER).

Constants

APPLICATION_TYPE_CONSUMER

Added in 1.1.0-beta01
public static final int APPLICATION_TYPE_CONSUMER = 1

Used with #mApplicationType to indicate this application is able and interested in querying a certain type of data.

APPLICATION_TYPE_PRODUCER

Added in 1.1.0-beta01
public static final int APPLICATION_TYPE_PRODUCER = 0

Used with #mApplicationType to indicate this application is ready and able to index a certain type of data.

Public methods

getApplicationType

Added in 1.1.0-beta01
public int getApplicationType()

Returns whether this app is interested in either producing or consuming the schema types listed in getSchemaTypes.

getId

Added in 1.1.0-beta01
public @NonNull String getId()

Returns the unique identifier for this GlobalSearchApplicationInfo.

getNamespace

Added in 1.1.0-beta01
public @NonNull String getNamespace()

Returns the namespace (or logical grouping) for this GlobalSearchApplicationInfo.

getSchemaTypes

Added in 1.1.0-beta01
public @NonNull List<@NonNull StringgetSchemaTypes()

Returns the list of schema type names this app is capable of producing (if getApplicationType is APPLICATION_TYPE_PRODUCER) or interested in consuming (if is #APPLICATION_TYPE_CONSUMER).