Stay organized with collections
Save and categorize content based on your preferences.
TrustedPresentationThresholds
class TrustedPresentationThresholds
Threshold values that are sent with Transaction.setTrustedPresentationCallback(SurfaceControl,
Summary
Public constructors
TrustedPresentationThresholds
TrustedPresentationThresholds(
minAlpha: Float,
minFractionRendered: Float,
stabilityRequirementMs: Int)
Creates a TrustedPresentationThresholds that's used when calling Transaction.setTrustedPresentationCallback(SurfaceControl,
Parameters |
minAlpha |
Float: The min alpha the SurfaceControl is required to have to be considered inside the threshold. Value is between 0.0f and 1.0f inclusive |
minFractionRendered |
Float: The min fraction of the SurfaceControl that was presented to the user to be considered inside the threshold. Value is between 0.0f and 1.0f inclusive |
stabilityRequirementMs |
Int: The time in milliseconds required for the SurfaceControl to be in the threshold. Value is 1 or greater |
Exceptions |
java.lang.IllegalArgumentException |
If threshold values are invalid. |
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-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# SurfaceControl.TrustedPresentationThresholds\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTrustedPresentationThresholds\n=============================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/SurfaceControl.TrustedPresentationThresholds \"View this page in Java\") \n\n```\nclass TrustedPresentationThresholds\n```\n\n|---|----------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.SurfaceControl.TrustedPresentationThresholds](#) |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 35.**\n|\n| Use [android.window.TrustedPresentationThresholds](../window/TrustedPresentationThresholds.html#) instead.\n\nThreshold values that are sent with [Transaction.setTrustedPresentationCallback(SurfaceControl,](/reference/kotlin/android/view/SurfaceControl.Transaction#setTrustedPresentationCallback(android.view.SurfaceControl,%20android.view.SurfaceControl.TrustedPresentationThresholds,%20java.util.concurrent.Executor,%20java.util.function.Consumer))\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [TrustedPresentationThresholds](#TrustedPresentationThresholds(kotlin.Float,%20kotlin.Float,%20kotlin.Int))`(`minAlpha:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `minFractionRendered:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `stabilityRequirementMs:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates a TrustedPresentationThresholds that's used when calling [Transaction.setTrustedPresentationCallback(SurfaceControl,](/reference/kotlin/android/view/SurfaceControl.Transaction#setTrustedPresentationCallback(android.view.SurfaceControl,%20android.view.SurfaceControl.TrustedPresentationThresholds,%20java.util.concurrent.Executor,%20java.util.function.Consumer)) |\n\nPublic constructors\n-------------------\n\n### TrustedPresentationThresholds\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nTrustedPresentationThresholds(\n minAlpha: Float, \n minFractionRendered: Float, \n stabilityRequirementMs: Int)\n```\n\nCreates a TrustedPresentationThresholds that's used when calling [Transaction.setTrustedPresentationCallback(SurfaceControl,](/reference/kotlin/android/view/SurfaceControl.Transaction#setTrustedPresentationCallback(android.view.SurfaceControl,%20android.view.SurfaceControl.TrustedPresentationThresholds,%20java.util.concurrent.Executor,%20java.util.function.Consumer))\n\n| Parameters ||\n|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `minAlpha` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html): The min alpha the [SurfaceControl](/reference/kotlin/android/view/SurfaceControl) is required to have to be considered inside the threshold. Value is between 0.0f and 1.0f inclusive |\n| `minFractionRendered` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html): The min fraction of the SurfaceControl that was presented to the user to be considered inside the threshold. Value is between 0.0f and 1.0f inclusive |\n| `stabilityRequirementMs` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The time in milliseconds required for the [SurfaceControl](/reference/kotlin/android/view/SurfaceControl) to be in the threshold. Value is 1 or greater |\n\n| Exceptions ||\n|--------------------------------------|----------------------------------|\n| `java.lang.IllegalArgumentException` | If threshold values are invalid. |"]]