# SurfaceControl.TrustedPresentationThresholds

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

# TrustedPresentationThresholds

*** ** * ** ***

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

```
class TrustedPresentationThresholds
```

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

*** ** * ** ***

| **This class was deprecated in API level 35.**
|
| Use[android.window.TrustedPresentationThresholds](https://developer.android.com/reference/kotlin/android/window/TrustedPresentationThresholds.html#)instead.

Threshold values that are sent with[Transaction.setTrustedPresentationCallback(SurfaceControl,](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.Transaction#setTrustedPresentationCallback(android.view.SurfaceControl,%20android.view.SurfaceControl.TrustedPresentationThresholds,%20java.util.concurrent.Executor,%20java.util.function.Consumer))

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [TrustedPresentationThresholds](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.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,](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.Transaction#setTrustedPresentationCallback(android.view.SurfaceControl,%20android.view.SurfaceControl.TrustedPresentationThresholds,%20java.util.concurrent.Executor,%20java.util.function.Consumer)) |

## Public constructors

### TrustedPresentationThresholds

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

```
TrustedPresentationThresholds(
    minAlpha: Float, 
    minFractionRendered: Float, 
    stabilityRequirementMs: Int)
```

Creates a TrustedPresentationThresholds that's used when calling[Transaction.setTrustedPresentationCallback(SurfaceControl,](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.Transaction#setTrustedPresentationCallback(android.view.SurfaceControl,%20android.view.SurfaceControl.TrustedPresentationThresholds,%20java.util.concurrent.Executor,%20java.util.function.Consumer))

|                                                                                                                                                        Parameters                                                                                                                                                         ||
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `minAlpha`               | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):The min alpha the[SurfaceControl](https://developer.android.com/reference/kotlin/android/view/SurfaceControl)is required to have to be considered inside the threshold. Value is between 0.0f and 1.0f inclusive |
| `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                                                            |
| `stabilityRequirementMs` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The time in milliseconds required for the[SurfaceControl](https://developer.android.com/reference/kotlin/android/view/SurfaceControl)to be in the threshold. Value is 1 or greater                                   |

|                               Exceptions                               ||
|--------------------------------------|----------------------------------|
| `java.lang.IllegalArgumentException` | If threshold values are invalid. |