SystemHealthManager.GetGpuHeadroom(GpuHeadroomParams) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides an estimate of available GPU capacity headroom of the device.
[Android.Runtime.Register("getGpuHeadroom", "(Landroid/os/GpuHeadroomParams;)F", "GetGetGpuHeadroom_Landroid_os_GpuHeadroomParams_Handler", ApiSince=36)]
public virtual float GetGpuHeadroom(Android.OS.GpuHeadroomParams? params);
[<Android.Runtime.Register("getGpuHeadroom", "(Landroid/os/GpuHeadroomParams;)F", "GetGetGpuHeadroom_Landroid_os_GpuHeadroomParams_Handler", ApiSince=36)>]
abstract member GetGpuHeadroom : Android.OS.GpuHeadroomParams -> single
override this.GetGpuHeadroom : Android.OS.GpuHeadroomParams -> single
Parameters
- params
- GpuHeadroomParams
params to customize the GPU headroom calculation, or null to use default.
Returns
a single value headroom or a Float.NaN
if it's temporarily unavailable.
Each valid value ranges from [0, 100], where 0 indicates no more cpu resources can be
granted.
- Attributes
Remarks
Provides an estimate of available GPU capacity headroom of the device.
The value can be used by the calling application to determine if the workload was GPU bound and then take action accordingly to ensure that the workload can be completed smoothly. It can also be used with the thermal status and headroom to determine if reducing the GPU bound workload can help reduce the device temperature to avoid thermal throttling.
If the params are valid, each call will perform at least one synchronous binder transaction that can take more than 1ms. So it's not recommended to call or wait for this on critical threads. Some devices may implement this as an on-demand API with lazy initialization, so the caller should expect higher latency when making the first call (especially with non-default params) since app starts or after changing params, as the device may need to change its data collection.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.