Builder


class Builder
kotlin.Any
   ↳ android.os.GpuHeadroomParams.Builder

Summary

Public constructors

Returns a new builder with the same values as this object.

Public methods
GpuHeadroomParams

Builds the GpuHeadroomParams object.

GpuHeadroomParams.Builder
setCalculationType(calculationType: Int)

Sets the headroom calculation type.

GpuHeadroomParams.Builder

Sets the headroom calculation window size in milliseconds.

Public constructors

Builder

Builder()

Builder

Builder(params: GpuHeadroomParams)

Returns a new builder with the same values as this object.

Parameters
params GpuHeadroomParams: This value cannot be null.

Public methods

build

fun build(): GpuHeadroomParams

Builds the GpuHeadroomParams object.

Return
GpuHeadroomParams This value cannot be null.

setCalculationType

fun setCalculationType(calculationType: Int): GpuHeadroomParams.Builder

Sets the headroom calculation type.

Parameters
calculationType Int: Value is android.os.GpuHeadroomParams#GPU_HEADROOM_CALCULATION_TYPE_MIN, or android.os.GpuHeadroomParams#GPU_HEADROOM_CALCULATION_TYPE_AVERAGE
Return
GpuHeadroomParams.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the type is invalid.

setCalculationWindowMillis

fun setCalculationWindowMillis(windowMillis: Int): GpuHeadroomParams.Builder

Sets the headroom calculation window size in milliseconds.

Parameters
windowMillis Int: the window size in milliseconds ranges from 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. The device will try to use the closest feasible window size to this param. Value is 1 or greater
Return
GpuHeadroomParams.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the window is invalid.