public final class

InternalVisibilityConfig.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.app.InternalVisibilityConfig.Builder

Overview

The builder class of InternalVisibilityConfig.

Summary

Constructors
publicBuilder(InternalVisibilityConfig internalVisibilityConfig)

Creates a InternalVisibilityConfig.Builder from an existing InternalVisibilityConfig

publicBuilder(java.lang.String schemaType)

Creates a InternalVisibilityConfig.Builder for a InternalVisibilityConfig.

Methods
public InternalVisibilityConfig.BuilderaddVisibleToConfig(SchemaVisibilityConfig schemaVisibilityConfig)

Add the SchemaVisibilityConfig for a caller need to match to access the schema this InternalVisibilityConfig represents.

public InternalVisibilityConfig.BuilderaddVisibleToPackage(PackageIdentifier packageIdentifier)

Add PackageIdentifier of packages which has access to this schema.

public InternalVisibilityConfig.BuilderaddVisibleToPermissions(java.util.Set<java.lang.Integer> visibleToPermissions)

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

public InternalVisibilityConfigbuild()

Build a InternalVisibilityConfig

public InternalVisibilityConfig.BuilderclearVisibleToConfig()

Clears the set of SchemaVisibilityConfig which have access to this schema.

public InternalVisibilityConfig.BuilderclearVisibleToPackages()

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

public InternalVisibilityConfig.BuilderclearVisibleToPermissions()

Clears all required permissions combinations set to this SchemaVisibilityConfig.

public InternalVisibilityConfig.BuildersetNotDisplayedBySystem(boolean notDisplayedBySystem)

Sets whether this schema has opted out of platform surfacing.

public InternalVisibilityConfig.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.

public InternalVisibilityConfig.BuildersetSchemaType(java.lang.String schemaType)

Sets schemaType, which will be as the id when converting to GenericDocument.

public InternalVisibilityConfig.BuildersetVisibilityConfig(SchemaVisibilityConfig schemaVisibilityConfig)

Resets all values contained in the VisibilityConfig with the values from the given VisibiltiyConfig.

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

Constructors

public Builder(java.lang.String schemaType)

Creates a InternalVisibilityConfig.Builder for a InternalVisibilityConfig.

Parameters:

schemaType: The SchemaType of the AppSearchSchema that this InternalVisibilityConfig represents. The package and database prefix will be added in server side. We are using prefixed schema type to be the final id of this InternalVisibilityConfig. This will be used as as an AppSearch id.

See also: GenericDocument.getId()

public Builder(InternalVisibilityConfig internalVisibilityConfig)

Creates a InternalVisibilityConfig.Builder from an existing InternalVisibilityConfig

Methods

public InternalVisibilityConfig.Builder setSchemaType(java.lang.String schemaType)

Sets schemaType, which will be as the id when converting to GenericDocument.

public InternalVisibilityConfig.Builder setVisibilityConfig(SchemaVisibilityConfig schemaVisibilityConfig)

Resets all values contained in the VisibilityConfig with the values from the given VisibiltiyConfig.

public InternalVisibilityConfig.Builder setNotDisplayedBySystem(boolean notDisplayedBySystem)

Sets whether this schema has opted out of platform surfacing.

public InternalVisibilityConfig.Builder addVisibleToPackage(PackageIdentifier packageIdentifier)

Add PackageIdentifier of packages which has access to this schema.

See also: SchemaVisibilityConfig.Builder.addAllowedPackage(PackageIdentifier)

public InternalVisibilityConfig.Builder clearVisibleToPackages()

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

See also: SchemaVisibilityConfig.Builder.clearAllowedPackages()

public InternalVisibilityConfig.Builder addVisibleToPermissions(java.util.Set<java.lang.Integer> visibleToPermissions)

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

See also: SchemaVisibilityConfig.Builder.addRequiredPermissions(Set)

public InternalVisibilityConfig.Builder clearVisibleToPermissions()

Clears all required permissions combinations set to this SchemaVisibilityConfig.

See also: SchemaVisibilityConfig.Builder.clearRequiredPermissions()

public InternalVisibilityConfig.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.

See also: SchemaVisibilityConfig.Builder.setPubliclyVisibleTargetPackage(PackageIdentifier)

public InternalVisibilityConfig.Builder addVisibleToConfig(SchemaVisibilityConfig schemaVisibilityConfig)

Add the SchemaVisibilityConfig for a caller need to match to access the schema this InternalVisibilityConfig represents.

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

Parameters:

schemaVisibilityConfig: The SchemaVisibilityConfig hold all requirements that a call must match to access the schema.

public InternalVisibilityConfig.Builder clearVisibleToConfig()

Clears the set of SchemaVisibilityConfig which have access to this schema.

Build a InternalVisibilityConfig