# DisplayHashManager

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

# DisplayHashManager

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/displayhash/DisplayHashManager "View this page in Java")  

```
class DisplayHashManager
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                             ||
| ↳ | [android.view.displayhash.DisplayHashManager](https://developer.android.com/reference/kotlin/android/view/displayhash/DisplayHashManager#) |

Manages DisplayHash requests. The manager object can be retrieved by calling`Context.getSystemService(Context.DISPLAY_HASH_SERVICE)`

## Summary

|                                                                                                                                                                                                                                                                            Public methods                                                                                                                                                                                                                                                                             ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\> | [getSupportedHashAlgorithms](https://developer.android.com/reference/kotlin/android/view/displayhash/DisplayHashManager#getSupportedHashAlgorithms())`()` Get a Set of DisplayHash algorithms that the device supports.                                                                                                                                                   |
| [VerifiedDisplayHash](https://developer.android.com/reference/kotlin/android/view/displayhash/VerifiedDisplayHash)?                                                                        | [verifyDisplayHash](https://developer.android.com/reference/kotlin/android/view/displayhash/DisplayHashManager#verifyDisplayHash(android.view.displayhash.DisplayHash))`(`displayHash:` `[DisplayHash](https://developer.android.com/reference/kotlin/android/view/displayhash/DisplayHash)`)` Call to verify that the DisplayHash passed in was generated by the system. |

## Public methods

### getSupportedHashAlgorithms

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

```
fun getSupportedHashAlgorithms(): MutableSet<String!>
```

Get a Set of DisplayHash algorithms that the device supports.

|                                                                                                                                                                              Return                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!> | a String Set of supported hashing algorithms. The String value of one algorithm should be used when requesting to generate the DisplayHash. This value cannot be`null`. |

### verifyDisplayHash

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

```
fun verifyDisplayHash(displayHash: DisplayHash): VerifiedDisplayHash?
```

Call to verify that the DisplayHash passed in was generated by the system.

|                                                                                              Parameters                                                                                               ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `displayHash` | [DisplayHash](https://developer.android.com/reference/kotlin/android/view/displayhash/DisplayHash):The hash to verify that it was generated by the system. This value cannot be`null`. |

|                                                                                                                                                         Return                                                                                                                                                          ||
|---------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [VerifiedDisplayHash](https://developer.android.com/reference/kotlin/android/view/displayhash/VerifiedDisplayHash)? | a[VerifiedDisplayHash](https://developer.android.com/reference/kotlin/android/view/displayhash/VerifiedDisplayHash)if the hash was generated by the system or null if the hash cannot be verified. |