SchemaVisibilityConfig.Builder

public static final classSchemaVisibilityConfig.BuilderextendsObject

The builder class ofSchemaVisibilityConfig.

Public Constructor Summary

Public Method Summary

SchemaVisibilityConfig.Builder
addAllowedPackage(PackageIdentifier packageIdentifier)
AddPackageIdentifier of packages which has access to this schema.
SchemaVisibilityConfig.Builder
addRequiredPermissions(Set<Integer> visibleToPermissions)
Adds a set of required AndroidManifest.permission combination a package needs to hold to access the schema this SchemaVisibilityConfigrepresents.
SchemaVisibilityConfig
SchemaVisibilityConfig.Builder
clearAllowedPackages()
Clears the list of packages which have access to this schema.
SchemaVisibilityConfig.Builder
clearRequiredPermissions()
Clears all required permissions combinations set to this SchemaVisibilityConfig.
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.

Inherited Method Summary

Public Constructors

Public Methods

publicSchemaVisibilityConfig.Builder addAllowedPackage(PackageIdentifier packageIdentifier)

AddPackageIdentifier of packages which has access to this schema.

publicSchemaVisibilityConfig.Builder addRequiredPermissions(Set<Integer> visibleToPermissions)

Adds a set of required AndroidManifest.permission combination a package needs to hold to access the schema thisSchemaVisibilityConfig represents.

If the querier holds ALL of the required permissions in this combination, they will have access to readGenericDocument 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().

publicSchemaVisibilityConfig.Builder clearAllowedPackages()

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

publicSchemaVisibilityConfig.Builder clearRequiredPermissions()

Clears all required permissions combinations set to thisSchemaVisibilityConfig.

publicSchemaVisibilityConfig.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 PackageManager.canPackageQuery(String, String).

It is possible for the packageIdentifier parameter to be different from the package performing the inde xing. 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 thePackageIdentifier of the package that will be used as the target package in a call to PackageManager.canPackageQuery(String, String)to determine which packages can access this publicly visible schema.