Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Summary
Public constructors |
|
Returns a new builder with the same values as this object.
|
Public constructors
Builder
Builder(params: GpuHeadroomParams)
Returns a new builder with the same values as this object.
Public methods
setCalculationType
fun setCalculationType(calculationType: Int): GpuHeadroomParams.Builder
Sets the headroom calculation type.
Exceptions |
java.lang.IllegalArgumentException |
if the type is invalid. |
setCalculationWindowMillis
fun setCalculationWindowMillis(windowMillis: Int): GpuHeadroomParams.Builder
Sets the headroom calculation window size in milliseconds.
Exceptions |
java.lang.IllegalArgumentException |
if the window is 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-03-13 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-03-13 UTC."],[],[],null,["# GpuHeadroomParams.Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/GpuHeadroomParams.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.os.GpuHeadroomParams.Builder](#) |\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n| [Builder](#Builder(android.os.GpuHeadroomParams))`(`params:` `[GpuHeadroomParams](/reference/kotlin/android/os/GpuHeadroomParams)`)` Returns a new builder with the same values as this object. |\n\n| Public methods ||\n|---------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GpuHeadroomParams](/reference/kotlin/android/os/GpuHeadroomParams) | [build](#build())`()` Builds the [GpuHeadroomParams](/reference/kotlin/android/os/GpuHeadroomParams) object. |\n| [GpuHeadroomParams.Builder](#) | [setCalculationType](#setCalculationType(kotlin.Int))`(`calculationType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the headroom calculation type. |\n| [GpuHeadroomParams.Builder](#) | [setCalculationWindowMillis](#setCalculationWindowMillis(kotlin.Int))`(`windowMillis:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the headroom calculation window size in milliseconds. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n``` \n\n### Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(params: GpuHeadroomParams)\n```\n\nReturns a new builder with the same values as this object.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------|\n| `params` | [GpuHeadroomParams](/reference/kotlin/android/os/GpuHeadroomParams): This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): GpuHeadroomParams\n```\n\nBuilds the [GpuHeadroomParams](/reference/kotlin/android/os/GpuHeadroomParams) object.\n\n| Return ||\n|---------------------------------------------------------------------|------------------------------|\n| [GpuHeadroomParams](/reference/kotlin/android/os/GpuHeadroomParams) | This value cannot be `null`. |\n\n### setCalculationType\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setCalculationType(calculationType: Int): GpuHeadroomParams.Builder\n```\n\nSets the headroom calculation type.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `calculationType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.os.GpuHeadroomParams#GPU_HEADROOM_CALCULATION_TYPE_MIN](/reference/kotlin/android/os/GpuHeadroomParams#GPU_HEADROOM_CALCULATION_TYPE_MIN:kotlin.Int), or [android.os.GpuHeadroomParams#GPU_HEADROOM_CALCULATION_TYPE_AVERAGE](/reference/kotlin/android/os/GpuHeadroomParams#GPU_HEADROOM_CALCULATION_TYPE_AVERAGE:kotlin.Int) |\n\n| Return ||\n|--------------------------------|------------------------------|\n| [GpuHeadroomParams.Builder](#) | This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|-------------------------|\n| `java.lang.IllegalArgumentException` | if the type is invalid. |\n\n### setCalculationWindowMillis\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setCalculationWindowMillis(windowMillis: Int): GpuHeadroomParams.Builder\n```\n\nSets the headroom calculation window size in milliseconds.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `windowMillis` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the window size in milliseconds ranges from [SystemHealthManager.getGpuHeadroomCalculationWindowRange()](/reference/kotlin/android/os/health/SystemHealthManager#getGpuHeadroomCalculationWindowRange()). The smaller the window size, the larger fluctuation in the headroom value should be expected. The default value can be retrieved from the [GpuHeadroomParams.getCalculationWindowMillis](/reference/kotlin/android/os/GpuHeadroomParams#getCalculationWindowMillis()). The device will try to use the closest feasible window size to this param. Value is 1 or greater |\n\n| Return ||\n|--------------------------------|------------------------------|\n| [GpuHeadroomParams.Builder](#) | This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|---------------------------|\n| `java.lang.IllegalArgumentException` | if the window is invalid. |"]]