public final class

SchemaVisibilityConfig.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.app.SchemaVisibilityConfig.Builder

Overview

The builder class of SchemaVisibilityConfig.

Summary

Constructors
publicBuilder()

Creates a SchemaVisibilityConfig.Builder for a SchemaVisibilityConfig.

publicBuilder(SchemaVisibilityConfig schemaVisibilityConfig)

Creates a SchemaVisibilityConfig.Builder copying the values from an existing SchemaVisibilityConfig.

Methods
public SchemaVisibilityConfig.BuilderaddAllowedPackage(PackageIdentifier packageIdentifier)

Add PackageIdentifier of packages which has access to this schema.

public SchemaVisibilityConfig.BuilderaddRequiredPermissions(java.util.Set<java.lang.Integer> visibleToPermissions)

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

public SchemaVisibilityConfigbuild()

Build a SchemaVisibilityConfig

public SchemaVisibilityConfig.BuilderclearAllowedPackages()

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

public SchemaVisibilityConfig.BuilderclearRequiredPermissions()

Clears all required permissions combinations set to this SchemaVisibilityConfig.

public SchemaVisibilityConfig.BuildersetPubliclyVisibleTargetPackage(PackageIdentifier packageIdentifier)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a SchemaVisibilityConfig.Builder for a SchemaVisibilityConfig.

public Builder(SchemaVisibilityConfig schemaVisibilityConfig)

Creates a SchemaVisibilityConfig.Builder copying the values from an existing SchemaVisibilityConfig.

Methods

public SchemaVisibilityConfig.Builder addAllowedPackage(PackageIdentifier packageIdentifier)

Add PackageIdentifier of packages which has access to this schema.

public SchemaVisibilityConfig.Builder clearAllowedPackages()

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

public SchemaVisibilityConfig.Builder addRequiredPermissions(java.util.Set<java.lang.Integer> visibleToPermissions)

Adds a set of required Android 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 SchemaVisibilityConfig.getRequiredPermissions().

See also: for supported Permissions.

public SchemaVisibilityConfig.Builder clearRequiredPermissions()

Clears all required permissions combinations set to this SchemaVisibilityConfig.

public SchemaVisibilityConfig.Builder setPubliclyVisibleTargetPackage(PackageIdentifier packageIdentifier)

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 android.content.pm.PackageManager.

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: the PackageIdentifier of the package that will be used as the target package in a call to android.content.pm.PackageManager to determine which packages can access this publicly visible schema.

public SchemaVisibilityConfig build()

Build a SchemaVisibilityConfig