# GetSchemaResponse

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#nestedclasses)\|[Inherited Constants](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#inhconstants)\|[Fields](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#lfields)\|[Methods](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#inhmethods)  

# GetSchemaResponse

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/app/appsearch/GetSchemaResponse "View this page in Kotlin")\|Java

`
public

final

class
GetSchemaResponse
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

|---|-----------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.appsearch.GetSchemaResponse |

<br />

*** ** * ** ***

The response class of[AppSearchSession.getSchema](https://developer.android.com/reference/android/app/appsearch/AppSearchSession#getSchema(java.util.concurrent.Executor,%20java.util.function.Consumer<android.app.appsearch.AppSearchResult<android.app.appsearch.GetSchemaResponse>>))

## Summary

|                                                                                                                   ### Nested classes                                                                                                                   ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [GetSchemaResponse.Builder](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse.Builder) Builder for[GetSchemaResponse](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse)objects. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

|                                                                                                                                                          ### Fields                                                                                                                                                          ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| ` public static final `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[GetSchemaResponse](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse)`>` | [CREATOR](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#CREATOR) <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[PackageIdentifier](https://developer.android.com/reference/android/app/appsearch/PackageIdentifier)`>`                                                                                                 | ` `[getPubliclyVisibleSchemas](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#getPubliclyVisibleSchemas())`() ` Returns a mapping of publicly visible schemas to the[PackageIdentifier](https://developer.android.com/reference/android/app/appsearch/PackageIdentifier)specifying the package the schemas are from.                                                                                                                                                                        |
| ` `[Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[Set](https://developer.android.com/reference/java/util/Set)`<`[Set](https://developer.android.com/reference/java/util/Set)`<`[Integer](https://developer.android.com/reference/java/lang/Integer)`>>>` | ` `[getRequiredPermissionsForSchemaTypeVisibility](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#getRequiredPermissionsForSchemaTypeVisibility())`() ` Returns a mapping of schema types to the set of[Manifest.permission](https://developer.android.com/reference/android/Manifest.permission)combination sets that querier must hold to access that schema type.                                                                                                                        |
| ` `[Set](https://developer.android.com/reference/java/util/Set)`<`[String](https://developer.android.com/reference/java/lang/String)`>`                                                                                                                                                                                                         | ` `[getSchemaTypesNotDisplayedBySystem](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#getSchemaTypesNotDisplayedBySystem())`() ` Returns all the schema types that are opted out of being displayed and visible on any system UI surface.                                                                                                                                                                                                                                                  |
| ` `[Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[Set](https://developer.android.com/reference/java/util/Set)`<`[SchemaVisibilityConfig](https://developer.android.com/reference/android/app/appsearch/SchemaVisibilityConfig)`>>`                       | ` `[getSchemaTypesVisibleToConfigs](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#getSchemaTypesVisibleToConfigs())`() ` Returns a mapping of schema types to the set of[SchemaVisibilityConfig](https://developer.android.com/reference/android/app/appsearch/SchemaVisibilityConfig)that have access to that schema type.                                                                                                                                                                |
| ` `[Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[Set](https://developer.android.com/reference/java/util/Set)`<`[PackageIdentifier](https://developer.android.com/reference/android/app/appsearch/PackageIdentifier)`>>`                                 | ` `[getSchemaTypesVisibleToPackages](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#getSchemaTypesVisibleToPackages())`() ` Returns a mapping of schema types to the set of packages that have access to that schema type.                                                                                                                                                                                                                                                                  |
| ` `[Set](https://developer.android.com/reference/java/util/Set)`<`[AppSearchSchema](https://developer.android.com/reference/android/app/appsearch/AppSearchSchema)`>`                                                                                                                                                                           | ` `[getSchemas](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#getSchemas())`() ` Return the schemas most recently successfully provided to[AppSearchSession.setSchema](https://developer.android.com/reference/android/app/appsearch/AppSearchSession#setSchema(android.app.appsearch.SetSchemaRequest,%20java.util.concurrent.Executor,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.app.appsearch.AppSearchResult<android.app.appsearch.SetSchemaResponse>>)). |
| ` int`                                                                                                                                                                                                                                                                                                                                          | ` `[getVersion](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#getVersion())`() ` Returns the overall database schema version.                                                                                                                                                                                                                                                                                                                                                              |
| ` void`                                                                                                                                                                                                                                                                                                                                         | ` `[writeToParcel](https://developer.android.com/reference/android/app/appsearch/GetSchemaResponse#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel.                                                                                                                                                                                                                                                    |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||
| From interface` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` `[describeContents](https://developer.android.com/reference/android/os/Parcelable#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                    | | ` abstract void` | ` `[writeToParcel](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel. | ||

## Fields

### CREATOR

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 13](https://developer.android.com/sdkExtensions)  

```
public static final Creator<GetSchemaResponse> CREATOR
```

<br />

<br />

## Public methods

### getPubliclyVisibleSchemas

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 13](https://developer.android.com/sdkExtensions)  

```
public Map<String, PackageIdentifier> getPubliclyVisibleSchemas ()
```

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

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

<br />

|                                                                                                                                     Returns                                                                                                                                      ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[PackageIdentifier](https://developer.android.com/reference/android/app/appsearch/PackageIdentifier)`>` | This value cannot be`null`. <br /> |

### getRequiredPermissionsForSchemaTypeVisibility

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 3](https://developer.android.com/sdkExtensions)  

```
public Map<String, Set<Set<Integer>>> getRequiredPermissionsForSchemaTypeVisibility ()
```

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

The querier could read the[GenericDocument](https://developer.android.com/reference/android/app/appsearch/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.

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[Set](https://developer.android.com/reference/java/util/Set)`<`[Set](https://developer.android.com/reference/java/util/Set)`<`[Integer](https://developer.android.com/reference/java/lang/Integer)`>>>` | The map contains schema type and all combinations of required permission for querier to access it. The supported Permission are[SetSchemaRequest.READ_SMS](https://developer.android.com/reference/android/app/appsearch/SetSchemaRequest#READ_SMS),[SetSchemaRequest.READ_CALENDAR](https://developer.android.com/reference/android/app/appsearch/SetSchemaRequest#READ_CALENDAR),[SetSchemaRequest.READ_CONTACTS](https://developer.android.com/reference/android/app/appsearch/SetSchemaRequest#READ_CONTACTS),[SetSchemaRequest.READ_EXTERNAL_STORAGE](https://developer.android.com/reference/android/app/appsearch/SetSchemaRequest#READ_EXTERNAL_STORAGE),[SetSchemaRequest.READ_HOME_APP_SEARCH_DATA](https://developer.android.com/reference/android/app/appsearch/SetSchemaRequest#READ_HOME_APP_SEARCH_DATA)and[SetSchemaRequest.READ_ASSISTANT_APP_SEARCH_DATA](https://developer.android.com/reference/android/app/appsearch/SetSchemaRequest#READ_ASSISTANT_APP_SEARCH_DATA). This value cannot be`null`. <br /> |

### getSchemaTypesNotDisplayedBySystem

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 3](https://developer.android.com/sdkExtensions)  

```
public Set<String> getSchemaTypesNotDisplayedBySystem ()
```

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

<br />

|                                                                                 Returns                                                                                  ||
|--------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [Set](https://developer.android.com/reference/java/util/Set)`<`[String](https://developer.android.com/reference/java/lang/String)`>` | This value cannot be`null`. <br /> |

### getSchemaTypesVisibleToConfigs

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 13](https://developer.android.com/sdkExtensions)  

```
public Map<String, Set<SchemaVisibilityConfig>> getSchemaTypesVisibleToConfigs ()
```

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

<br />

|                                                                                                                                                                          Returns                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[Set](https://developer.android.com/reference/java/util/Set)`<`[SchemaVisibilityConfig](https://developer.android.com/reference/android/app/appsearch/SchemaVisibilityConfig)`>>` | This value cannot be`null`. <br /> |

**See also:**

- [SetSchemaRequest.Builder.addSchemaTypeVisibleToConfig(String, SchemaVisibilityConfig)](https://developer.android.com/reference/android/app/appsearch/SetSchemaRequest.Builder#addSchemaTypeVisibleToConfig(java.lang.String,%20android.app.appsearch.SchemaVisibilityConfig))  

### getSchemaTypesVisibleToPackages

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 3](https://developer.android.com/sdkExtensions)  

```
public Map<String, Set<PackageIdentifier>> getSchemaTypesVisibleToPackages ()
```

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

<br />

|                                                                                                                                                                     Returns                                                                                                                                                                      ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [Map](https://developer.android.com/reference/java/util/Map)`<`[String](https://developer.android.com/reference/java/lang/String)`, `[Set](https://developer.android.com/reference/java/util/Set)`<`[PackageIdentifier](https://developer.android.com/reference/android/app/appsearch/PackageIdentifier)`>>` | This value cannot be`null`. <br /> |

### getSchemas

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

Return the schemas most recently successfully provided to[AppSearchSession.setSchema](https://developer.android.com/reference/android/app/appsearch/AppSearchSession#setSchema(android.app.appsearch.SetSchemaRequest,%20java.util.concurrent.Executor,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.app.appsearch.AppSearchResult<android.app.appsearch.SetSchemaResponse>>)).

<br />

|                                                                                                Returns                                                                                                 ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [Set](https://developer.android.com/reference/java/util/Set)`<`[AppSearchSchema](https://developer.android.com/reference/android/app/appsearch/AppSearchSchema)`>` | This value cannot be`null`. <br /> |

### getVersion

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getVersion ()
```

Returns the overall database schema version.

If the database is empty, 0 will be returned.

<br />

|               Returns               ||
|-------|------------------------------|
| `int` | Value is 0 or greater <br /> |

### writeToParcel

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

|                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | `Parcel`: This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE). Value is either`0`or a combination of[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES <br /> |