ThermalGuard is an OutSystems 11 mobile plugin that allows mobile applications to retrieve the device's current thermal status using the native Android PowerManager API.
PowerManager
It helps applications understand the thermal condition reported by the Android operating system and make informed decisions based on the device's thermal state.
The plugin provides two client actions:
CheckThermalStateAvailability – Checks whether the device supports the Android thermal status API.
GetCurrentThermalState – Retrieves the device's current thermal status.
Important: ThermalGuard retrieves the thermal status reported by Android. It does not measure the device's physical temperature in degrees Celsius.
Retrieves the current Android thermal status.
Checks whether thermal status information is supported.
Provides both a readable thermal state and its numeric status code.
Uses the native Android PowerManager API.
Does not require additional Android permissions.
Lightweight Cordova plugin implementation.
Supports on-demand thermal status checks.
The plugin is Android-only. It does not provide iOS support.
Add the following configuration to the OutSystems mobile application's Extensibility Configuration:
{ "plugin": { "url": "https://github.com/murali838/cordova-plugin-thermal-state.git" } }
After configuring the plugin, rebuild the mobile application to include the native implementation.
Description
Checks whether the device supports the Android thermal status API.
The plugin checks whether the Android version is API 29 or higher.
Inputs
No inputs required.
Outputs
Usage
Call this action before retrieving thermal status to verify API availability.
Expected behavior
Android 10 or higher: IsAvailable = True
IsAvailable = True
Android versions below Android 10: IsAvailable = False
IsAvailable = False
Retrieves the current thermal status reported by the Android operating system using the native PowerManager API.
Call this action to retrieve the device's current thermal condition.
The action returns both a readable state and its corresponding numeric code.
Android provides the following thermal status values:
These values represent the thermal status reported by Android, not a temperature measurement.
A typical implementation can follow these steps:
Step 1 – Check API availability
Call CheckThermalStateAvailability.
CheckThermalStateAvailability
If IsAvailable is True, proceed to the next step.
IsAvailable
Otherwise, display an appropriate message indicating that the device does not support the API.
Step 2 – Retrieve the thermal status
Call GetCurrentThermalState.
GetCurrentThermalState
Step 3 – Process the result
Check IsSuccess before using the returned values.
IsSuccess
Use ThermalState or ThermalStateCode to determine the device's current thermal condition.
ThermalState
ThermalStateCode
Example output
{ "ThermalState": "MODERATE", "ThermalStateCode": 2, "IsSuccess": true, "ErrorMessage": "" }
The values above illustrate a sample response.
ThermalGuard can be used in mobile applications to:
Display the device's current thermal condition.
Reduce resource-intensive operations when higher thermal states are reported.
Adjust background processing based on thermal conditions.
Help developers investigate device performance under different thermal conditions.
Provide thermal-status information for diagnostics and monitoring screens.
These are potential application scenarios; the plugin itself only retrieves the current thermal status.
Android-only implementation.
Requires Android 10 (API 29) or higher.
Retrieves the current thermal status on demand.
Does not provide continuous thermal monitoring or thermal-status change listeners.
Does not return the actual device temperature in Celsius or Fahrenheit.
Does not control device cooling or thermal throttling.
Does not guarantee that every thermal status level will be observed during testing, as Android reports the status based on device conditions.
The plugin was integrated and tested in an OutSystems 11 mobile application on a physical OnePlus 13 device.
The following thermal states were successfully observed during testing:
The availability check also returned successfully on the tested device.
Other thermal status levels have not been individually verified.
ThermalGuard is released under the MIT License.
Created by: Murali Manoharan V
Plugin Repository:https://github.com/murali838/cordova-plugin-thermal-state
Asset: ThermalGuard – Device Thermal State Plugin