GetSchemaResponse

class GetSchemaResponse


The response class of getSchemaAsync

Summary

Nested types

Builder for GetSchemaResponse objects.

Public functions

(Mutable)Map<String!, (Mutable)Set<(Mutable)Set<Int!>!>!>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
getRequiredPermissionsForSchemaTypeVisibility()

Returns a mapping of schema types to the Map of android.Manifest.permission combinations that querier must hold to access that schema type.

(Mutable)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.

(Mutable)Map<String!, (Mutable)Set<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.

(Mutable)Set<AppSearchSchema!>

Return the schemas most recently successfully provided to setSchemaAsync.

@IntRange(from = 0) Int

Returns the overall database schema version.

Public functions

getRequiredPermissionsForSchemaTypeVisibility

Added in 1.1.0-alpha04
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getRequiredPermissionsForSchemaTypeVisibility(): (Mutable)Map<String!, (Mutable)Set<(Mutable)Set<Int!>!>!>

Returns a mapping of schema types to the Map of android.Manifest.permission combinations 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 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.
Returns
(Mutable)Map<String!, (Mutable)Set<(Mutable)Set<Int!>!>!>

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-alpha04
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getSchemaTypesNotDisplayedBySystem(): (Mutable)Set<String!>

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

getSchemaTypesVisibleToPackages

Added in 1.1.0-alpha04
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getSchemaTypesVisibleToPackages(): (Mutable)Map<String!, (Mutable)Set<PackageIdentifier!>!>

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

getSchemas

Added in 1.1.0-alpha04
fun getSchemas(): (Mutable)Set<AppSearchSchema!>

Return the schemas most recently successfully provided to setSchemaAsync.

It is inefficient to call this method repeatedly.

getVersion

Added in 1.1.0-alpha04
fun getVersion(): @IntRange(from = 0) Int

Returns the overall database schema version.

If the database is empty, 0 will be returned.