PowerManager.IOnThermalHeadroomChangedListener.OnThermalHeadroomChanged Method

Definition

Called when overall thermal headroom or headroom thresholds have significantly changed that requires action.

[Android.Runtime.Register("onThermalHeadroomChanged", "(FFILjava/util/Map;)V", "GetOnThermalHeadroomChanged_FFILjava_util_Map_Handler:Android.OS.PowerManager/IOnThermalHeadroomChangedListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=36)]
public void OnThermalHeadroomChanged(float headroom, float forecastHeadroom, int forecastSeconds, System.Collections.Generic.IDictionary<Java.Lang.Integer,Java.Lang.Float> thresholds);
[<Android.Runtime.Register("onThermalHeadroomChanged", "(FFILjava/util/Map;)V", "GetOnThermalHeadroomChanged_FFILjava_util_Map_Handler:Android.OS.PowerManager/IOnThermalHeadroomChangedListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=36)>]
abstract member OnThermalHeadroomChanged : single * single * int * System.Collections.Generic.IDictionary<Java.Lang.Integer, Java.Lang.Float> -> unit

Parameters

headroom
Single

current headroom

forecastHeadroom
Single

forecasted headroom in future

forecastSeconds
Int32

how many seconds in the future used in forecast

thresholds
IDictionary<Integer,Float>

new headroom thresholds, see #getThermalHeadroomThresholds()

Attributes

Remarks

Called when overall thermal headroom or headroom thresholds have significantly changed that requires action.

This may not be used to fully replace the #getThermalHeadroom(int) API as it will only notify on one of the conditions below that will significantly change one or both values of current headroom and headroom thresholds since previous callback: 1. thermal throttling events: when the skin temperature has cross any of the thresholds and there isn't a previous callback in a short time ago with similar values. 2. skin temperature threshold change events: note that if the absolute °C threshold values change in a way that does not significantly change the current headroom nor headroom thresholds, it will not trigger any callback. The client should not need to take action in such case since the difference from temperature vs threshold hasn't changed.

By API version 36, it provides a forecast in the same call for developer's convenience based on a forecastSeconds defined by the device, which can be static or dynamic varied by OEM. Be aware that it will not notify on forecast temperature change but the events mentioned above. So periodically polling against #getThermalHeadroom(int) API should still be used to actively monitor temperature forecast in advance.

This serves as a more advanced option compared to thermal status listener, where the latter will only notify on thermal throttling events with status update.

Java documentation for android.os.PowerManager.OnThermalHeadroomChangedListener.onThermalHeadroomChanged(float, float, int, java.util.Map<java.lang.Integer, java.lang.Float>).

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.

Applies to