SchemaVisibilityConfig.Builder


class SchemaVisibilityConfig.Builder


The builder class of SchemaVisibilityConfig.

Summary

Public constructors

Creates a Builder for a SchemaVisibilityConfig.

Public functions

SchemaVisibilityConfig.Builder

Add PackageIdentifier of packages which has access to this schema.

SchemaVisibilityConfig.Builder
addRequiredPermissions(visibleToPermissions: (Mutable)Set<Int!>)

Adds a set of required Android android.Manifest.permission combination a package needs to hold to access the schema this SchemaVisibilityConfig represents.

SchemaVisibilityConfig

Build a SchemaVisibilityConfig

SchemaVisibilityConfig.Builder

Clears the list of packages which have access to this schema.

SchemaVisibilityConfig.Builder

Clears all required permissions combinations set to this SchemaVisibilityConfig.

SchemaVisibilityConfig.Builder

Specify that this schema should be publicly available, to the same packages that have visibility to the package passed as a parameter.

Public constructors

Builder

Added in 1.1.0-alpha04
Builder()

Creates a Builder for a SchemaVisibilityConfig.

Public functions

addAllowedPackage

Added in 1.1.0-alpha04
fun addAllowedPackage(packageIdentifier: PackageIdentifier): SchemaVisibilityConfig.Builder

Add PackageIdentifier of packages which has access to this schema.

addRequiredPermissions

Added in 1.1.0-alpha04
fun addRequiredPermissions(visibleToPermissions: (Mutable)Set<Int!>): SchemaVisibilityConfig.Builder

Adds a set of required Android android.Manifest.permission combination a package needs to hold to access the schema this SchemaVisibilityConfig represents.

If the querier holds ALL of the required permissions in this combination, they will have access to read GenericDocument objects of the given schema type.

You can call this method repeatedly to add multiple permission combinations, and the querier will have access if they holds ANY of the combinations.

Merged Set available from getRequiredPermissions.

See also
addRequiredPermissionsForSchemaTypeVisibility

for supported Permissions.

clearAllowedPackages

Added in 1.1.0-alpha04
fun clearAllowedPackages(): SchemaVisibilityConfig.Builder

Clears the list of packages which have access to this schema.

clearRequiredPermissions

Added in 1.1.0-alpha04
fun clearRequiredPermissions(): SchemaVisibilityConfig.Builder

Clears all required permissions combinations set to this SchemaVisibilityConfig.

setPubliclyVisibleTargetPackage

Added in 1.1.0-alpha04
fun setPubliclyVisibleTargetPackage(packageIdentifier: PackageIdentifier?): SchemaVisibilityConfig.Builder

Specify that this schema should be publicly available, to the same packages that have visibility to the package passed as a parameter. This visibility is determined by the result of canPackageQuery.

It is possible for the packageIdentifier parameter to be different from the package performing the indexing. This might happen in the case of an on-device indexer processing information about various packages. The visibility will be the same regardless of which package indexes the document, as the visibility is based on the packageIdentifier parameter.

Calling this with packageIdentifier set to null is valid, and will remove public visibility for the schema.

Parameters
packageIdentifier: PackageIdentifier?

the PackageIdentifier of the package that will be used as the target package in a call to canPackageQuery to determine which packages can access this publicly visible schema.