GetSchemaResponse


public final class GetSchemaResponse
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.appsearch.GetSchemaResponse


The response class of AppSearchSession#getSchema

Summary

Nested classes

class GetSchemaResponse.Builder

Builder for GetSchemaResponse objects. 

Inherited constants

Fields

public static final Creator<GetSchemaResponse> CREATOR

Public methods

Map<StringPackageIdentifier> getPubliclyVisibleSchemas()

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

Map<StringSet<Set<Integer>>> getRequiredPermissionsForSchemaTypeVisibility()

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

Set<String> getSchemaTypesNotDisplayedBySystem()

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

Map<StringSet<SchemaVisibilityConfig>> getSchemaTypesVisibleToConfigs()

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

Map<StringSet<PackageIdentifier>> getSchemaTypesVisibleToPackages()

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

Set<AppSearchSchema> getSchemas()

Return the schemas most recently successfully provided to AppSearchSession#setSchema.

int getVersion()

Returns the overall database schema version.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 35
public static final Creator<GetSchemaResponse> CREATOR

Public methods

getPubliclyVisibleSchemas

Added in API level 35
public Map<StringPackageIdentifier> getPubliclyVisibleSchemas ()

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.

Returns
Map<StringPackageIdentifier> This value cannot be null.

getRequiredPermissionsForSchemaTypeVisibility

Added in API level 33
public Map<StringSet<Set<Integer>>> getRequiredPermissionsForSchemaTypeVisibility ()

Returns a mapping of schema types to the set of 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
Map<StringSet<Set<Integer>>> The map contains schema type and all combinations of required permission for querier to access it. The supported Permission are SetSchemaRequest#READ_SMS, SetSchemaRequest.READ_CALENDAR, SetSchemaRequest#READ_CONTACTS, SetSchemaRequest.READ_EXTERNAL_STORAGE, SetSchemaRequest.READ_HOME_APP_SEARCH_DATA and SetSchemaRequest.READ_ASSISTANT_APP_SEARCH_DATA. This value cannot be null.

getSchemaTypesNotDisplayedBySystem

Added in API level 33
public Set<String> getSchemaTypesNotDisplayedBySystem ()

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

Returns
Set<String> This value cannot be null.

getSchemaTypesVisibleToConfigs

Added in API level 35
public Map<StringSet<SchemaVisibilityConfig>> getSchemaTypesVisibleToConfigs ()

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

Returns
Map<StringSet<SchemaVisibilityConfig>> This value cannot be null.

getSchemaTypesVisibleToPackages

Added in API level 33
public Map<StringSet<PackageIdentifier>> getSchemaTypesVisibleToPackages ()

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

Returns
Map<StringSet<PackageIdentifier>> This value cannot be null.

getSchemas

Added in API level 31
public Set<AppSearchSchema> getSchemas ()

Return the schemas most recently successfully provided to AppSearchSession#setSchema.

Returns
Set<AppSearchSchema> This value cannot be null.

getVersion

Added in API level 31
public int getVersion ()

Returns the overall database schema version.

If the database is empty, 0 will be returned.

Returns
int Value is 0 or greater

writeToParcel

Added in API level 35
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES