GetSchemaResponse


public final class GetSchemaResponse


The response class of getSchemaAsync

Summary

Nested types

public final class GetSchemaResponse.Builder

Builder for GetSchemaResponse objects.

Public methods

@NonNull Map<StringPackageIdentifier>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
getPubliclyVisibleSchemas()

Returns a mapping of publicly visible schemas to the PackageIdentifier specifying the package the schemas are from.

@NonNull Map<StringSet<Set<Integer>>>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
getRequiredPermissionsForSchemaTypeVisibility()

Returns a mapping of schema types to the set of android.Manifest.permission combination sets that querier must hold to access that schema type.

@NonNull Set<String>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
getSchemaTypesNotDisplayedBySystem()

Returns all the schema types that are opted out of being displayed and visible on any system UI surface.

@NonNull Map<StringSet<SchemaVisibilityConfig>>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
getSchemaTypesVisibleToConfigs()

Returns a mapping of schema types to the set of SchemaVisibilityConfig that have access to that schema type.

@NonNull Map<StringSet<PackageIdentifier>>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
getSchemaTypesVisibleToPackages()

Returns a mapping of schema types to the set of packages that have access to that schema type.

@NonNull Set<AppSearchSchema>

Return the schemas most recently successfully provided to setSchemaAsync.

@IntRange(from = 0) int

Returns the overall database schema version.

Public methods

getPubliclyVisibleSchemas

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
public @NonNull Map<StringPackageIdentifiergetPubliclyVisibleSchemas()

Returns a mapping of publicly visible schemas to the PackageIdentifier specifying the package the schemas are from.

If no schemas have been set as publicly visible, an empty set will be returned.

getRequiredPermissionsForSchemaTypeVisibility

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
public @NonNull Map<StringSet<Set<Integer>>> getRequiredPermissionsForSchemaTypeVisibility()

Returns a mapping of schema types to the set of android.Manifest.permission combination sets that querier must hold to access that 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 holding both PermissionA and PermissionB has access.
  • A querier holding both PermissionC and PermissionD has access.
  • A querier holding only PermissionE has access.
  • A querier holding both PermissionA and PermissionE has access.
  • A querier holding only PermissionA doesn't have access.
  • A querier holding only PermissionA and PermissionC doesn't have access.
Returns
@NonNull Map<StringSet<Set<Integer>>>

The map contains schema type and all combinations of required permission for querier to access it. The supported Permission are READ_SMS, READ_CALENDAR, READ_CONTACTS, READ_EXTERNAL_STORAGE, READ_HOME_APP_SEARCH_DATA and READ_ASSISTANT_APP_SEARCH_DATA.

getSchemaTypesNotDisplayedBySystem

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
public @NonNull Set<StringgetSchemaTypesNotDisplayedBySystem()

Returns all the schema types that are opted out of being displayed and visible on any system UI surface.

getSchemaTypesVisibleToConfigs

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
public @NonNull Map<StringSet<SchemaVisibilityConfig>> getSchemaTypesVisibleToConfigs()

Returns a mapping of schema types to the set of SchemaVisibilityConfig that have access to that schema type.

getSchemaTypesVisibleToPackages

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
public @NonNull Map<StringSet<PackageIdentifier>> getSchemaTypesVisibleToPackages()

Returns a mapping of schema types to the set of packages that have access to that schema type.

getSchemas

Added in 1.1.0-alpha07
public @NonNull Set<AppSearchSchemagetSchemas()

Return the schemas most recently successfully provided to setSchemaAsync.

getVersion

Added in 1.1.0-alpha07
public @IntRange(from = 0) int getVersion()

Returns the overall database schema version.

If the database is empty, 0 will be returned.