# GetSchemaResponse

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/GetSchemaResponse.java+class:androidx.appsearch.app.GetSchemaResponse) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class GetSchemaResponse
```

<br />

*** ** * ** ***

The response class of `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession#getSchemaAsync()`

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse` objects. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/androidx/appsearch/app/PackageIdentifier>` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getPubliclyVisibleSchemas()()` Returns a mapping of publicly visible schemas to the `https://developer.android.com/reference/androidx/appsearch/app/PackageIdentifier` specifying the package the schemas are from. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/Integer.html>>>` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getRequiredPermissionsForSchemaTypeVisibility()()` Returns a mapping of schema types to the set of `https://developer.android.com/reference/android/Manifest.permission.html` combination sets that querier must hold to access that schema type. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/String.html>` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getSchemaTypesNotDisplayedBySystem()()` Returns all the schema types that are opted out of being displayed and visible on any system UI surface. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig>>` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getSchemaTypesVisibleToConfigs()()` Returns a mapping of schema types to the set of `https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig` that have access to that schema type. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/appsearch/app/PackageIdentifier>>` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getSchemaTypesVisibleToPackages()()` Returns a mapping of schema types to the set of packages that have access to that schema type. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/appsearch/app/AppSearchSchema>` | `https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getSchemas()()` Return the schemas most recently successfully provided to `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession#setSchemaAsync(androidx.appsearch.app.SetSchemaRequest)`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath>>` | `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getSchemasWipeoutAccountPropertyPaths()()` Returns a map containing all schema types that have been configured for account wipeout, mapped to the specific property paths within those schemas that hold the account identifiers. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | `https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse#getVersion()()` Returns the overall database schema version. |

## Public methods

### getPubliclyVisibleSchemas

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

Returns a mapping of publicly visible schemas to the `https://developer.android.com/reference/androidx/appsearch/app/PackageIdentifier` specifying the package the schemas are from.

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

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getRequiredPermissionsForSchemaTypeVisibility

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

Returns a mapping of schema types to the set of `https://developer.android.com/reference/android/Manifest.permission.html` combination sets that querier must hold to access that schema type.

The querier could read the `https://developer.android.com/reference/androidx/appsearch/app/GenericDocument` objects under the `schemaType` if they holds ALL required permissions of ANY of the individual value sets.

For example, if the Map contains `{ % verbatim %}{ {permissionA, PermissionB},
{ PermissionC, PermissionD}, {PermissionE}}{ % endverbatim %}`.

- 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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/Integer.html>>>` | The map contains schema type and all combinations of required permission for querier to access it. The supported Permission are `https://developer.android.com/reference/androidx/appsearch/app/SetSchemaRequest#READ_SMS()`, `https://developer.android.com/reference/androidx/appsearch/app/SetSchemaRequest#READ_CALENDAR()`, `https://developer.android.com/reference/androidx/appsearch/app/SetSchemaRequest#READ_CONTACTS()`, `https://developer.android.com/reference/androidx/appsearch/app/SetSchemaRequest#READ_EXTERNAL_STORAGE()`, `https://developer.android.com/reference/androidx/appsearch/app/SetSchemaRequest#READ_HOME_APP_SEARCH_DATA()` and `https://developer.android.com/reference/androidx/appsearch/app/SetSchemaRequest#READ_ASSISTANT_APP_SEARCH_DATA()`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getSchemaTypesNotDisplayedBySystem

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

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

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getSchemaTypesVisibleToConfigs

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

Returns a mapping of schema types to the set of `https://developer.android.com/reference/androidx/appsearch/app/SchemaVisibilityConfig` that have access to that schema type.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/appsearch/app/SetSchemaRequest.Builder#addSchemaTypeVisibleToConfig(java.lang.String,androidx.appsearch.app.SchemaVisibilityConfig)` |   |

### getSchemaTypesVisibleToPackages

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

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

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getSchemas

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull Set<AppSearchSchema> getSchemas()
```

Return the schemas most recently successfully provided to `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession#setSchemaAsync(androidx.appsearch.app.SetSchemaRequest)`.

### getSchemasWipeoutAccountPropertyPaths

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
@ExperimentalAppSearchApi
public @NonNull Map<String, Set<PropertyPath>> getSchemasWipeoutAccountPropertyPaths()
```

Returns a map containing all schema types that have been configured for account wipeout, mapped to the specific property paths within those schemas that hold the account identifiers.

This method performs a deep copy to ensure the returned map and its contained sets are immutable from external modifications.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath>>` | A map where keys are schema type names, and values are sets of `https://developer.android.com/reference/androidx/appsearch/app/PropertyPath` strings configured for account wipeout for that schema type. |

### getVersion

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @IntRange(from = 0) int getVersion()
```

Returns the overall database schema version.

If the database is empty, 0 will be returned.