GlobalSearchApplicationInfo


@ExperimentalAppSearchApi
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.VERBATIM_SEARCH)
@Document(name = "builtin:GlobalSearchApplicationInfo")
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

Constants

const Int

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

const Int

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

Public functions

Int

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

String

Returns the unique identifier for this GlobalSearchApplicationInfo.

String

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

(Mutable)List<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
const val APPLICATION_TYPE_CONSUMER = 1: Int

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
const val APPLICATION_TYPE_PRODUCER = 0: Int

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

Public functions

getApplicationType

Added in 1.1.0-beta01
fun getApplicationType(): Int

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

getId

Added in 1.1.0-beta01
fun getId(): String

Returns the unique identifier for this GlobalSearchApplicationInfo.

getNamespace

Added in 1.1.0-beta01
fun getNamespace(): String

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

getSchemaTypes

Added in 1.1.0-beta01
fun getSchemaTypes(): (Mutable)List<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).