Stay organized with collections
Save and categorize content based on your preferences.
DisplayHashManager
class DisplayHashManager
Manages DisplayHash requests. The manager object can be retrieved by calling Context.getSystemService(Context.DISPLAY_HASH_SERVICE)
Summary
Public methods |
MutableSet<String!> |
Get a Set of DisplayHash algorithms that the device supports.
|
VerifiedDisplayHash? |
Call to verify that the DisplayHash passed in was generated by the system.
|
Public methods
getSupportedHashAlgorithms
fun getSupportedHashAlgorithms(): MutableSet<String!>
Get a Set of DisplayHash algorithms that the device supports.
Return |
MutableSet<String!> |
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
fun verifyDisplayHash(displayHash: DisplayHash): VerifiedDisplayHash?
Call to verify that the DisplayHash passed in was generated by the system.
Parameters |
displayHash |
DisplayHash: The hash to verify that it was generated by the system. This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DisplayHashManager\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDisplayHashManager\n==================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/displayhash/DisplayHashManager \"View this page in Java\") \n\n```\nclass DisplayHashManager\n```\n\n|---|--------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.displayhash.DisplayHashManager](#) |\n\nManages DisplayHash requests. The manager object can be retrieved by calling `Context.getSystemService(Context.DISPLAY_HASH_SERVICE)`\n\nSummary\n-------\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e | [getSupportedHashAlgorithms](#getSupportedHashAlgorithms())`()` Get a Set of DisplayHash algorithms that the device supports. |\n| [VerifiedDisplayHash](/reference/kotlin/android/view/displayhash/VerifiedDisplayHash)? | [verifyDisplayHash](#verifyDisplayHash(android.view.displayhash.DisplayHash))`(`displayHash:` `[DisplayHash](/reference/kotlin/android/view/displayhash/DisplayHash)`)` Call to verify that the DisplayHash passed in was generated by the system. |\n\nPublic methods\n--------------\n\n### getSupportedHashAlgorithms\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getSupportedHashAlgorithms(): MutableSet\u003cString!\u003e\n```\n\nGet a Set of DisplayHash algorithms that the device supports.\n\n| Return ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\u003e | 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`. |\n\n### verifyDisplayHash\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun verifyDisplayHash(displayHash: DisplayHash): VerifiedDisplayHash?\n```\n\nCall to verify that the DisplayHash passed in was generated by the system.\n\n| Parameters ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `displayHash` | [DisplayHash](/reference/kotlin/android/view/displayhash/DisplayHash): The hash to verify that it was generated by the system. This value cannot be `null`. |\n\n| Return ||\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [VerifiedDisplayHash](/reference/kotlin/android/view/displayhash/VerifiedDisplayHash)? | a [VerifiedDisplayHash](/reference/kotlin/android/view/displayhash/VerifiedDisplayHash) if the hash was generated by the system or null if the hash cannot be verified. |"]]