GetSchemaResponse.Builder

class GetSchemaResponse.Builder


Builder for GetSchemaResponse objects.

Summary

Public constructors

Create a Builder object}

Public functions

GetSchemaResponse.Builder

Adds one AppSearchSchema to the schema list.

GetSchemaResponse.Builder

Sets whether or not documents from the provided schemaType will be displayed and visible on any system UI surface.

GetSchemaResponse

Builds a GetSchemaResponse object.

GetSchemaResponse.Builder
setRequiredPermissionsForSchemaTypeVisibility(
    schemaType: String,
    visibleToPermissions: (Mutable)Set<(Mutable)Set<Int!>!>
)

Sets a set of required android.Manifest.permission combinations to the given schema type.

GetSchemaResponse.Builder
setSchemaTypeVisibleToPackages(
    schemaType: String,
    packageIdentifiers: (Mutable)Set<PackageIdentifier!>
)

Sets whether or not documents from the provided schemaType can be read by the specified package.

GetSchemaResponse.Builder
setVersion(version: @IntRange(from = 0) Int)

Sets the database overall schema version.

Public constructors

Builder

Added in 1.1.0-alpha04
Builder()

Create a Builder object}

Public functions

addSchema

Added in 1.1.0-alpha04
fun addSchema(schema: AppSearchSchema): GetSchemaResponse.Builder

Adds one AppSearchSchema to the schema list.

addSchemaTypeNotDisplayedBySystem

Added in 1.1.0-alpha04
fun addSchemaTypeNotDisplayedBySystem(schemaType: String): GetSchemaResponse.Builder

Sets whether or not documents from the provided schemaType will be displayed and visible on any system UI surface.

Parameters
schemaType: String

The name of an AppSearchSchema within the same GetSchemaResponse, which won't be displayed by system.

build

Added in 1.1.0-alpha04
fun build(): GetSchemaResponse

Builds a GetSchemaResponse object.

setRequiredPermissionsForSchemaTypeVisibility

Added in 1.1.0-alpha04
fun setRequiredPermissionsForSchemaTypeVisibility(
    schemaType: String,
    visibleToPermissions: (Mutable)Set<(Mutable)Set<Int!>!>
): GetSchemaResponse.Builder

Sets a set of required android.Manifest.permission combinations to the given schema type.

The querier could read the GenericDocument objects under the schemaType if they holds ALL required permissions of ANY of the individual value sets.

For example, if the Map contains {{permissionA, PermissionB}, {PermissionC, PermissionD}, {PermissionE}}.

  • A querier holds both PermissionA and PermissionB has access.
  • A querier holds both PermissionC and PermissionD has access.
  • A querier holds only PermissionE has access.
  • A querier holds both PermissionA and PermissionE has access.
  • A querier holds only PermissionA doesn't have access.
  • A querier holds both PermissionA and PermissionC doesn't have access.
Parameters
schemaType: String

The schema type to set visibility on.

visibleToPermissions: (Mutable)Set<(Mutable)Set<Int!>!>

The Android permissions that will be required to access the given schema.

setSchemaTypeVisibleToPackages

Added in 1.1.0-alpha04
fun setSchemaTypeVisibleToPackages(
    schemaType: String,
    packageIdentifiers: (Mutable)Set<PackageIdentifier!>
): GetSchemaResponse.Builder

Sets whether or not documents from the provided schemaType can be read by the specified package.

Each package is represented by a PackageIdentifier, containing a package name and a byte array of type CERT_INPUT_SHA256.

To opt into one-way data sharing with another application, the developer will need to explicitly grant the other application’s package name and certificate Read access to its data.

For two-way data sharing, both applications need to explicitly grant Read access to one another.

Parameters
schemaType: String

The schema type to set visibility on.

packageIdentifiers: (Mutable)Set<PackageIdentifier!>

Represents the package that has access to the given schema type.

setVersion

Added in 1.1.0-alpha04
fun setVersion(version: @IntRange(from = 0) Int): GetSchemaResponse.Builder

Sets the database overall schema version.

Default version is 0