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 |
|---|
public final class GlobalSearchApplicationInfo.BuilderBuilder class for |
Constants |
|
|---|---|
static final int |
Used with |
static final int |
Used with |
Public methods |
|
|---|---|
int |
Returns whether this app is interested in either producing or consuming the schema types listed in |
@NonNull String |
getId()Returns the unique identifier for this |
@NonNull String |
Returns the namespace (or logical grouping) for this |
@NonNull List<@NonNull String> |
Returns the list of schema type names this app is capable of producing (if |
Constants
APPLICATION_TYPE_CONSUMER
public static final int APPLICATION_TYPE_CONSUMER = 1
Used with getApplicationType to indicate this application is able and interested in querying a certain type of data.
APPLICATION_TYPE_PRODUCER
public static final int APPLICATION_TYPE_PRODUCER = 0
Used with getApplicationType to indicate this application is ready and able to index a certain type of data.
Public methods
getApplicationType
public int getApplicationType()
Returns whether this app is interested in either producing or consuming the schema types listed in getSchemaTypes.
getId
public @NonNull String getId()
Returns the unique identifier for this GlobalSearchApplicationInfo.
getNamespace
public @NonNull String getNamespace()
Returns the namespace (or logical grouping) for this GlobalSearchApplicationInfo.
getSchemaTypes
public @NonNull List<@NonNull String> getSchemaTypes()
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).